Displaying 20 results from an estimated 90000 matches similar to: "error when I use render(:layout=>false)"
2008 Dec 18
2
Render a view from console
Hello!
In my application I''m trying to render a view from a class in /lib
folder. I have found that it''s very similar to render a view from
console. So, I have tried different methods:
>> string = ActionView::Base.new.render( :inline => ''works'', :layout => false )
=> "works"
>> string = ActionView::Base.new.render( :template =>
2008 Aug 30
5
make layout false
Hi
i am having lot of HTML files those files dont want layouts so, for
each rhtml i am mentioning in controller list.rhtml,edit.rhtml
def list
render :layout=>false
end
def edit
render :layout=>false
end
is any simple method to mention wat are the files dont want layout in
one line..
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
2007 Jul 28
2
specing a call to render :layout => "some_layout"
I''m trying to specify that an action should be rendered with a given layout
one particular spec.
What I''ve got at the moment is this.
it "should render with the grabber layout" do
controller.should_receive( :render ).with( :layout => "my_layout" )
do_get
end
This doesnt work even though this call to render is being executed.
render :layout
2010 Oct 27
0
"Missing partial layouts/application" error on render :partial => "index", :layout => "application" - Rails3
This is the second time I have seen this error, and been googling around and
cant find an explanation. This error is happening with Rails 3/1.9.2 and was
not with Rails 2.3.8/1.8.7:
*Template is missing
Missing partial layouts/application with {:handlers=>[:erb, :rjs, :builder,
:rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths
2007 Aug 21
1
Render template not matching absolute path
Hi
I have a simple controller method like this:
class StylesheetsController < ApplicationController
layout nil
session :off
def gap
site = Site.find_by_hostname(request.host)
@colours = site.colours
respond_to do |accepts|
accepts.css { render :file => "#{RAILS_ROOT}/app/views/
stylesheets/gap.rcss" }
end
end
end
And I want to test that
2008 May 08
2
Testing render :text without has_text
A controller I''m trying to test simply delivers a text string to the
client, which then demarshalls it to retrieve some objects. I want to
test that the returned string is correct.
I don''t want to compare the string character-by-character with
response.has_text because that ties me to the implementation of the
Marshall class. Instead, I just want to demarshall the string
2006 May 17
9
Render No Layout?
Hi guys,
Am having a problem.
I have this def in my index controller that works like this:
def do_something
$a = variable1
$b = variable2
$c = variable3
$d = ""<script language=\"Javascript\"> \n new Insertion.Bottom(''#{$c}'',
''#{$a} - #{$b}''); \n </script>"
$trigger = "1"
render(:partial =>
2012 Jul 26
2
Using the :layout option when calling render @variable
Hey everybody,
I wanted to use the :layout option when calling render @variable (where
@variable is some ActiveRecord class instance with a corresponding
variables/_variable.html.erb partial view), but as far as I know, Rails
doesn''t support this.
Here''s a quick patch that allows to use the :layout function:
In partial_renderer.rb, add the following elsif block:
if
2006 May 18
3
Render layout on the fly
Hi guys,
i was wondering if there is any possibility to render a layout on the
fly instead of putting it into the layouts/ folder. Any ideas?
--
Posted via http://www.ruby-forum.com/.
2009 May 15
0
[PATCH server] use service layer for Network controller.
There's still room for additional refactoring as we may want to eventually split out nic, bonding, and ip address manipulation into their own controller/svc module, but that would be a much more extensive redesign than we want to deal with for the overall service layer creation refactoring.
Signed-off-by: Scott Seago <sseago at redhat.com>
---
src/app/controllers/network_controller.rb
2006 Apr 03
8
Layout problem
Hi,
I am creating a blog to learn ruby on rails. The blog.rhtml in the
layout folder has a the following code
<td width=150 valign="top">This is the left menu</td>
<td width=600 valign="top"><%= @content_for_layout %></td>
<td width=150 valign ="top"><%= render :partial => "categorylist",
:collection =>
2013 Nov 19
0
specifying partial layout with a block to render
<%= render collection do %>
<li><%= yield %></li>
<% end %>
there are many cases when you wouldn''t want to create layout files
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
2007 Nov 03
1
Specs for Helpers that call render
The helper spec I am writing tests a helper method that calls render.
##
module HelperHelper
def render_partial
render :partial => ''partial''
end
end
##
The helper spec.
##
describe HelperHelper do
it "should render partial" do
render_partial.should_not == nil
end
end
##
The output generated
##
$ spec spec/helpers/home_helper_spec.rb
.F
1)
2011 Aug 28
3
rspec-rails render_views doesn't render layouts? / how to check flash isn't rendered
I''m trying to test that "static" pages (they''re ERB, but get cached),
generated through rails, don''t render any stray flash notices left over by
the authentication system (Devise) or wherever else.
I''ve tried writing this controller spec, but it appears that response.body
only renders the template, not its layouts?
describe "so that static
2005 Dec 27
1
Odd Behavior with render
I''d been trying to iterate through an array of hashes using the
ActionController''s render method. Unfortunately, it appears that when
I use a hash as one of the array elements, it gets passed as a nil to
the partial. Here''s some code:
@books = [ ''hello'', ''hello2'' ]
render :partial => "book",
2006 Mar 14
5
Best way to use partial rendering in global layout
I have a global layout in application.rhtml and I''d like to render a
partial template within it.
Currently, I have this:
<%= render (:partial => ''side_nav'') %>
but it seems to be looking in the controller specific view directory.
What is the best way to do handle controller - global partial rendering?
Wes
--
Posted via http://www.ruby-forum.com/.
2012 Aug 13
2
Render collection of objects
Hello!
I''m trying to render a template this way (below), but the object is nil at
_category.html.erb file.
index.html.erb
<%= render @categories %>
_category.html.erb
<%=category.name %>
error:
undefined method `name'' for nil:NilClass
With show.html.erb file it''s render.
Thanks
--
You received this message because you are subscribed to the
2006 Apr 11
0
can''t get render... :collection to work ??
Hi all -
New to Rails so I''m hoping this is something obvious, but I can''t get it
to work. Here''s my view:
----------------------------------------------------------------------
<% @search.results.each do |r| %>
<%= render :partial => ''result'', :locals => {:result => r} %>
<%= render :partial =>
2006 Dec 17
1
Markaby template & layout (can't get them to work together)
Hi all,
I am starting a new rails app with the Markaby plugin (had some issues
installing, but think its working).
First, i created an index.mab file for a controller containing:
h1 "First template"
That rendered fine. Also, I do not have a "def index ..." in the
controller.
Then I created an app/layouts/application.mab file. It didn''t get picked
up until after
2006 Oct 19
1
Question about variable assignments/scoping after render call
I''ve got a question about how variables are made available to templates. We
have a test that looks something like this:
def test_variable_assigned
xhr :get, :do_stuff, :id => 1
assert_not_nil assigns(:thing)
end
And our app code looks like this:
class SuperClass < ActionController
def do_stuff
@parent_model = ParentModel.find(params[:id])
render :template