I have a form that submits search criteria and while it is processing I wanted to use a js function to indicate: <% form_remote_tag :update => ''mainbody'', :url => {:action => ''search''}, :before => "wait_message(''mainbody'',''S E A R C H I N G'')" do%> wait_message() executes but then when the data comes back, I get ActionController::InvalidAuthenticityToken in DocdirController#search Everything works fine without the :before => callback. How should I do this? -- Posted via http://www.ruby-forum.com/.
Here are more details from that error: Processing DocdirController#search (for 127.0.0.1 at 2009-06-04 11:34:39) [POST] ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): <internal:prelude>:8:in `synchronize'' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'' /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'' -- Posted via http://www.ruby-forum.com/.
I suppose it was not a good idea to replace the form with "removeChild" :before the form is submitted... -- Posted via http://www.ruby-forum.com/.
Sandip Ransing
2009-Jun-05 11:16 UTC
Re: ActionController::InvalidAuthenticityToken & :before
In your controller add skip_before_filter :verify_authenticity_token Hope this will help ! Sandip R~ -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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 -~----------~----~----~----~------~----~------~--~---
Sandip Ransing wrote:> In your controller add > skip_before_filter :verify_authenticity_token > > Hope this will help !Thanks for that tidbit, but the problem was that the wait_message() function destroyed the content of the div with the form in it and replaced it with the message, S E A R C H I N G Of course, the form is not yet submitted and it contained the auth token in a hidden field! So the more is: don''t destroy the form in your :before callback. -- Posted via http://www.ruby-forum.com/.