Tuesday, 10 September 2013

can't use collection outside resource(s) scope + devise + autocomplete

can't use collection outside resource(s) scope + devise + autocomplete

I am trying to use autocomplete via autocomplete at the time of user
registrations using devise.
I get this error when defining the routes.
Here is my code :-
Registration Controller :-
class RegistrationsController < Devise::RegistrationsController
autocomplete :location, :name
end
Routes :-
devise_for :users, :controllers => {:registrations => "registrations"} do
get :autocomplete_location_name, :on => :collection
end
Form :-
=f.autocomplete_field :location_name, autocomplete_location_name_path
I want user to enter their location at the time of registration. I have
got location model and want to autocomplete the fields based on the
location data which I have got.

No comments:

Post a Comment