Forum: Ruby on Rails render :layout => false still renders

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
E9cb84e4dd4c0133293fb7c80ab331fc?d=identicon&s=25 Aaron Wally (wheels)
on 2007-05-15 21:34
Are there some exceptions to this command?  I was having problems with
an ajax form still rendering the layout, then copy-pasted this code from
an ebook to test it and it gives a "template is missing" error as though
it's still trying to render.

def reverse
  @reversed_text = params[:text_to_reverse].reverse
  render :layout => false

<%= form_remote_tag :update => "reversed",
                    :url    => { :action => 'reverse' } %>
  <p>Text to reverse: <%= text_field_tag 'text_to_reverse' %></p>
  <p id="reversed"></p>
  <p><%= submit_tag 'Reverse!' %></p>
<%= end_form_tag %>

917533d6bb5803079146c8bfb16d58b6?d=identicon&s=25 Guest (Guest)
on 2007-05-15 22:31
> Suggestions?
maybe a render :inline => @reversed_text, :layout => false
E9cb84e4dd4c0133293fb7c80ab331fc?d=identicon&s=25 Aaron Wally (wheels)
on 2007-05-15 22:41
that works, thanks
15eb647956921a6bc9655c3513feb139?d=identicon&s=25 lanzm (Guest)
on 2007-05-15 22:46
(Received via mailing list)
try this:

  render :text => @reversed_text, :layout => false

or with rjs

  render :update do |page|
    page.replace_html "reversed", @reversed_text

the layout is more a thing "around" a template you render; views/
layouts/application.rhtml for example is the best place to put in your
html <head/> tag

for the topic checkout the api-manual

or the best book about it :-)

On 15 Mai, 21:34, Aaron Wally <>
This topic is locked and can not be replied to.