jeudi 15 octobre 2015

Undefined Method in Devise Routes with User ID

Currently I have a typical devise installation but I've added user-id's to the routes that have a current_user available. But I'm getting the error stated below when trying to login to the service.

undefined local variable or method `user_offers' def after_sign_in_path_for(resource) user_offers

routes.rb

devise_for :users

resources :users do
  resources :offers do
    member do
       put :tourcomplete
    end   
  end
end

Rake Routes

 tourcomplete_user_offer PUT    /users/:user_id/offers/:id/tourcomplete(.:format) offers#tourcomplete
             user_offers GET    /users/:user_id/offers(.:format)                  offers#index
                         POST   /users/:user_id/offers(.:format)                  offers#create
          new_user_offer GET    /users/:user_id/offers/new(.:format)              offers#new
         edit_user_offer GET    /users/:user_id/offers/:id/edit(.:format)         offers#edit
              user_offer GET    /users/:user_id/offers/:id(.:format)              offers#show
                         PATCH  /users/:user_id/offers/:id(.:format)              offers#update
                         PUT    /users/:user_id/offers/:id(.:format)              offers#update
                         DELETE /users/:user_id/offers/:id(.:format)              offers#destroy
                   users GET    /users(.:format)                                  users#index
                         POST   /users(.:format)                                  users#create

Not too sure if this is the best way to put user-id's within the logged in routes. Would love any help on this issue.

Aucun commentaire:

Enregistrer un commentaire