In my app I assign a url's href
attribute as profile_path
when using resources :profiles
in my routes.rb file. I do not pass any id into profile_path
yet the app somehow correctly assumes that it is the profile of the current_user
. How does rails know this? Is this simply a default that rails assumes if you don't pass in an id?
If you have set up a before_filter in your controller with Devise where profile_path requires a user to sign in first, it will default to the current_user helper to send the current_user's id along with the request.
As an aside to the question's comment thread, to test what routes you have set up, run rake routes
in terminal and you'll see if you have Devise routes set up.