How to customize devise form css in rails

devise, ruby, ruby-on-rails, ruby-on-rails-3, sass

Solution

Devise will use you default layout. So the CSS that you are using in your `views/layouts/application.html.erb` will be used in your generated devise views.

If you want devise specific layouts, you can create a `views/layouts/devise.html.erb` file where you can serve devise specific CSS. It will pick it up automatically because of Rails naming conventions.

The above will work for any controller, just add a file in layouts named after the controller eg. `views/layouts/reservations.html.erb` for `ReservationsController`

You can also add specific layouts for the `Devise::RegistrationsController` by making a directory `views/layouts/devise` and adding `views/layouts/devise/registrations.html.erb`

Problem

Command `rails generate devise:views` successfully created folders under `\app\views\users` I am looking to customize the devise forms but not sure whether the css to be placed in `application.css` or i need to separately create `user.css.scss`. Googled a bit and check git doc for this but none is specifying for CSS handling in devise. Let me know the correct way of handling it

Original source