Strange behaviour collection on the resources

My route is as follows:
map.namespace :admin do |admin|

admin.resources :campaigns, :collection=>{
:auto_complete_for_client_name=>:post,
:auto_complete_for_user_login=>:post}
end

The auto complete prototype POST request for the client_name is
working, but the user_login never gets properly recognized.

Though I am able to recognize the route if I add it manually instead
of using the resources. Is anyone having such problems?

This may not be any help, but I might learn something.

I pasted your route declaration and got, among others, these two
routes from rake routes.

auto_complete_for_user_login_admin_campaigns POST /admin/campaigns/
auto_complete_for_user_login
{:controller=>“admin/
campaigns”, :action=> “auto_complete_for_user_login”}

formatted_auto_complete_for_user_login_admin_campaigns POST /admin/
campaigns/auto_complete_for_user_login.:format
{:controller=>“admin/
campaigns”, :action=>“auto_complete_for_user_login”}

What route is it you don’t have?
can you post the code that manually adds the route?

if you need to get rid of the admin in the route add “:name_prefix =>
nil”
auto_complete_for_user_login_admin_campaigns goes to:
auto_complete_for_user_login_campaigns

map.namespace :admin do |admin|

admin.resources :campaigns, :collection=>{
:auto_complete_for_client_name=>:post,
:auto_complete_for_user_login=>:post}, :name_prefix
=> nil
end

On May 11, 1:15 pm, blj [email protected] wrote:

My route is as follows:
map.namespace :admin do |admin|

admin.resources :campaigns, :collection=>{ :auto_complete_for_client_name=>:post, :auto_complete_for_user_login=>:post}
end

The auto complete prototype POST request for the client_name is
working, but the user_login never gets properly recognized.

Well thanks for the response. I am not sure what the error was. After
I updated my rails copy to the more recent from edge, it started to
work.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs