user2206724
user2206724

Reputation: 1365

Devise/Rails: after_sign_up_path_for(resource)

I am using devise in my rails app to user sign up/in. On sign up, i want to redirect user to its profile page.

I did rake routes and for edit, root is :

/profiles/:id/edit

I wrote this in registrations controller:

def after_sign_up_path_for(resource)
'http://localhost:3000/profiles/#{resource.id}/edit'
end

But it is not working. Can anybody help?

Upvotes: 0

Views: 1184

Answers (1)

rmagnum2002
rmagnum2002

Reputation: 11421

shouldn't you use:

def after_sign_up_path_for(resource)
  edit_profile_path(resource)
end

instead of hardcoded http://localhost:3000/profiles/#{resource.id}/edit

would be helpfull to have your routes file posted too.

Upvotes: 3

Related Questions