Render :layout => false still renders

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
end

<%= form_remote_tag :update => “reversed”,
:url => { :action => ‘reverse’ } %>

Text to reverse: <%= text_field_tag 'text_to_reverse' %>

<%= submit_tag 'Reverse!' %>

<%= end_form_tag %>

Suggestions?

Suggestions?
maybe a render :inline => @reversed_text, :layout => false

that works, thanks

try this:

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

or with rjs

render :update do |page|
page.replace_html “reversed”, @reversed_text
end

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 tag

for the topic checkout the api-manual
http://api.rubyonrails.org/classes/ActionController/Base.html#M000267

or the best book about it :slight_smile:
http://www.pragmaticprogrammer.com/titles/rails/index.html

On 15 Mai, 21:34, Aaron W. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs