Rails 3 render :partials
Posted
by
user297221
on Stack Overflow
See other posts from Stack Overflow
or by user297221
Published on 2010-06-24T18:42:55Z
Indexed on
2011/01/03
19:53 UTC
Read the original article
Hit count: 224
Hi guys.
I am migrating my 1.8.7 rails app to rails 3. But I have a problem with a partial: I have the following partial:
in my cms controller :
@clients = Client.all
group = render_to_string :layout => 'layouts/window', :partial => 'clients/index'
in my "clients/index" partial:
<%= render :partial => 'clients/item', :collection => @clients %>
This worked great with rails 1.7.8 but with rails 3 only the partial in the index get's rendered!. So, to clarify this, the group variable in the controller doesn't get the html from the layout. Also the weird thing is that the window layout is _window.erb (if I do window.html.erb or just window.erb rails can't find it which is strange).
Does anybody know if this behavior is normal for rails 3?
thanxs!
© Stack Overflow or respective owner