Chris Olsen
2008-Feb-15 18:04 UTC
Rendering partials within controller failing on js requests
I am wondering if this is just me or...?
I have a partial contacts/_contact_details.html.erb that works fine when
rendering for a html request. When I make a js request and have the
render :partial within the controller code it fails and tells me it was
unable to find the file.
Here is the controller code:
def show
@contact = Contact.find(params[:id])
respond_to do |format|
format.html
format.js { render :partial => "contacts/contact_details",
:object
=> @contact }
end
end
There is a post to the rails trac regarding this where the solution is
said that partials should have a extension of .rhtml rather than
html.erb
The post can be found here http://dev.rubyonrails.org/ticket/10113
Is this correct or rather is this they way it is supposed to be? In all
the 2.x docs I have seen partials have the html.erb extention.
If I change the partial file to _contact_details.rhtml it works as it
should for both js and html requests.
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---