Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customizing Devise views in Rails

I'm using devise for user auth, but I have nice mockups for the signup, login, etc. pages. I've already done the rails generate devise:views User command and have all of the views in the views folder, however, when I replaced the registration/new.html.erb with my own new.html.erb, nothing changes nor looks different. It's as if I had done anything.

Anyone know what I'm doing wrong or at least how to successfully customize devise views

P.S. Is it important to note that I changed the route of devise/registration#new to /signup?

like image 581
Vasseurth Avatar asked Jul 11 '11 07:07

Vasseurth


People also ask

Does devise work with rails 7?

Our out-of-the box Devise setup is now working with Rails 7. Once again, if you'd like to refer to any of the code for this setup, or use the template wholesale for a new app, the code is available on GitHub, and you may also use it as a template repo to kick off your own Rails 7 devise projects.


1 Answers

at a glance answer.

...instead of

rails generate devise:views User 

use:

rails generate devise:views 

If you've already done it, move the folders devise created from app/views/User to a new folder app/views/devise (or just rename the User folder to devise, if that's an option.)

Those folders are:

app/views/User/confirmations app/views/User/mailer app/views/User/passwords app/views/User/registrations app/views/User/sessions app/views/User/shared app/views/User/unlocks 

No other changes are necessary.

like image 155
ocodo Avatar answered Oct 16 '22 03:10

ocodo