Hi Railies I''m somewhat stuck trying to add some AJAX to my app, AJAX newbie stuff I guess: View: <div id="ajax_list">list</div> <div id="ajax_form">form</div> <%= link_to_remote ''GO'', :update => ''ajax_form'', :url => { :action => ''test'' } %> Controller: def test render :update do |page| page.replace_html ''ajax_list'', ''just testing'' page.replace_html ''ajax_form'', ''here too'' end end When I hit the GO link, I get this output dumped in the ajax_form-div: NoMethodError in CompanyController#test undefined method `+'' for #<Mime::Type:0x25cc57c> #{RAILS_ROOT}/app/controllers/application.rb:164:in `set_charset'' (...) My code does look wrong to me, too, with ajax_form appearing in both link_to_remote and replace_html. But I don''t seem to be able to figure out the right way to do it. Big thanks for your help!! -- 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 -~----------~----~----~----~------~----~------~--~---
Fixed it, an application helper that altered headers caused the issue. -- 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 -~----------~----~----~----~------~----~------~--~---
Not sure if this was part of the fix or not, but don''t mix the use of the :update option in the remote call with a render :update. You''ll end up with js rendered into your target element. On Aug 21, 6:00 am, Sven Schwyn <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Fixed it, an application helper that altered headers caused the issue. > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---