i've generated the devise views using rails g devise:views and then also followed the instructions to add the web-app-theme to sign but devise does not use that layout.
how you I change the devise layout to use web-app-theme?
You need to create a new layout file, specifically for logging in.
- app
- views
- layouts
application.html.erb
- devise
sessions.html.erb
So you have your application layout file, but you also have a folder called devise, and in it, is a layout file for devise sessions. Rails should automatically pick up this layout and use it since it is the same path and name as the view being displayed (views/devise/sessions) so it'll look for views/layouts/devise/sessions, and if it doesn't find it, it'll check if it's defined elsewhere.
UPDATE
Here's another potential solution I found on Stackoverflow.
Integrate layouts with Devise
UPDATE 2
A third option is to do what the devise wiki says.
How To: Create Custom Layouts
Related
I'm working on a rails app and to modify the layout of devise pages i used on the root of my rails application
rails g devise:views
so in the directory
app/views
i have all the files of the devise gem.
now that my work is ended i would like to hide those files again maintaining the modifies , how can i do it?
if you know even a way to only hide password it could also work
i didn't found any help in the README file for the plugins
I need to do own administration logic, with it's controllers, view etc... ActiveAdmin and so over are not good for me. But how can i do this in other directory (for example controllers/admin/). How to write then rails g command? (view must be in folder admin too). Also how to connect twitter bootstrap only for admin controllers?
Have a look at this link, where they use the same admin subdirectory grouping (link broken) example. The example is for an older version of Rails, but should be relatively valid for Rails 3.2.
Edit: See this namespaces question.
rails generate controller admin/Users
For bootstrap, just don't use the bootstrap specific id/class attributes in your admin stylesheet.
I am a new bie to Rails Devise Gem. In order to apply a custom layout and coloring, I've modified original forms that come with devise installation. I am wondering if this approach is right. Or shall I create a new set of forms that should override default devise forms.
rails generate devise:views
Then, look at devise folder at views folder, you will see all the forms you need to customize
The correct method is to generate the devise views and then style them as you have been doing.
I created the /views/user/ folder using rails g devise:views but devise is still using the default views somehow.
Am I missing a configuration somewhere?
Yes, read documentation and add to your config/initializers/devise.rb
config.scoped_views = true
Also see that rails g devise:views create app/views/devise containing all needed views. If you don't have many Devise Models in your app DO NOT use above solution but simply edit files in app/views/devise. Then it will work faster, because it don't need to look every time for specified views.
is there a way to get devise to show * for required fields on sign up page in views?
rails 3.0.5 devise 1.2
Yes. If you run rails generate devise:views devise will generate its views into app/views/devise. Then you can add as many * as you like in there.
Have a look at the simple_form gem. It will add the * automatically and even provide inline validation. But this is just an addition, editing the views will solve your problem.