Heh--I do. Just went through this.
Because you''re calling the partial from the format.js{} block,
you''ve
got to name it _result.js.erb. Nevermind that it''s actually HTML
what''s
in that file--just call it .js.erb.
(Also--your :url param there looks odd to me--why are you tacking on the
.js suffix? I would think that by virtue of the fact you''re making an
XHR request, that rails'' routing magic would get that done for you...)
HTH,
-Roy
-----Original Message-----
From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
[mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of
Matt Grande
Sent: Thursday, May 01, 2008 6:58 AM
To: Ruby on Rails: Talk
Subject: [Rails] Ajax + Format.js = :(
Hi all,
I''m calling a method in my controller like this:
<%= link_to_remote ''Search'', :url => customers_path +
''.js'', :with =>
"''name='' + $(''name'').value",
:method => :get, :update => ''customers'' -
%>
And then updating my page like this:
format.js { render :partial => ''customers/result'',
:collection =>
@customers }
And my app is telling me that the partial doesn''t exist where it
should... However, it does. There is definately a partial in app/
views/customers called _result.html.erb.
Does anyone know what would be causing this?
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---