Xavier Noria wrote: > On Wed, Sep 3, 2008 at 11:40 PM, Neil Cauldwell > <[EMAIL PROTECTED]> wrote: > >> <% form_for ([EMAIL PROTECTED], @invitation]), :id => "invitation_form" do >> |f| >> %> >> <%= belongs_to_auto_completer :invitation, :recipient, :name %> >> <%= f.submit 'Send Invitation', :class => "action_button submit" %> >> <% end %> >> </div> > > Hi Neil, that's related to Ajax calls and the request from forgery > protection. Just google for > "ActionController::InvalidAuthenticityToken ajax".
I couldn't work out why I was getting the ActionController::InvalidAuthenticityToken on this particular form_for, even after doing some reading round. I tried two approaches, and neither resolved the issue; [1] <% form_for ([EMAIL PROTECTED], @invitation]), :id => "invitation_form" do |f| %> [2] <% form_for :invitation, :url => group_invitations_path(@group) do |f| %> So, to skip the trial & error on the token problem, I commented out the protect_from_forgery, just so I could get the auto_complete actually working first, and I don't seem to get any results back at all. I'm still using the same set up as before and I did have the auto_complete plugin working, so I know it's not a problem with js. When I un-comment the display="none" on the hidden div, it seems as though it contains a whole new DOM within the hidden div; the whole of another application.html.erb seems to be hidden in there! Any ideas left? -- 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

