Hi, i am working jquery+rails in view i sent data to contoller''s action and in that i action i tried to replace div with partial page using following def search_new @manufact=Manufacturer.find_by_manufacturer_id(manf_id) respond_to do |format| format.html format.js { render(:update) {|page| page << "$.("#search_new").html("<%escape_javascript(render(:partial => "search_new"))%>")" } } end end but its not performing any action, could any one provide me solution ? thanks, -pab -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Monday 19 September 2011 06:29 PM, Pab wrote:> Hi, > > > i am working jquery+rails in view i sent data to contoller''s > action and in that i action i tried to replace div with partial page > using following > def search_new > @manufact=Manufacturer.find_by_manufacturer_id(manf_id) > respond_to do |format| > format.html > format.js { > render(:update) {|page| > page<< "$.("#search_new").html("<%> escape_javascript(render(:partial => "search_new"))%>")" > } > } > end > end > > but its not performing any action, could any one provide me solution ? > > thanks, > -pab >def search_new @manufact=Manufacturer.find_by_manufacturer_id(manf_id) respond_to do |format| format.js do render do |page| page.replace_html "search_new",:partial => "search_new " end end end end Try the above code. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
replace_html is a Prototype helper and has been deprecated in Rails 3.1 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/TGE1y-zZsy0J. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, replace_html is prototype method so it won''t work, could u provide me any other solution that supports jquery ? thanks, -pab -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
First of all it looks like you have a syntax error in the JavaScript: $.("#search_new") should be $("#search_new") If that doesn''t fix the issue, there still might be something else wrong. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ShOqoIrm4nMJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.