remote_function keeps adding authenticity token on GET requests
Posted
by jaycode
on Stack Overflow
See other posts from Stack Overflow
or by jaycode
Published on 2010-04-16T21:11:57Z
Indexed on
2010/04/16
21:13 UTC
Read the original article
Hit count: 272
Hi,
I got the problem similar to this post here: https://rails.lighthouseapp.com/projects/8994/tickets/106-authenticity_token-appears-in-urls-after-ajax-get-request
routes.rb
map.namespace(:admin, :active_scaffold => true) do |admin|
admin.resources :regions, :shallow => true do |region|
region.resources :birds, :collection => {:search => :get}
end
end
view
<%= javascript_tag %Q(
#{remote_function(:update => 'bird_search', :url => search_admin_region_birds_path(@region.id), :method => :get)}
) %>
It displays url like: http://localhost:3000/admin/regions/7/birds/search?authenticity_token=F43BcQUM4z3bl7s21kLZQrqwGkuErF7C9jiNMKFTZTo%3D
which should be: http://localhost:3000/admin/regions/7/birds/search
Without this working my Ajax pagination won't work... help!
© Stack Overflow or respective owner