Rails devise generate Views for User Module - ruby-on-rails

We are using devise for our rails application. I have run the following commands to install and generate devise into the app.
rails generate devise:install
rails generate devise user
Now I want to generate the views for the User model at app/views/users/ instead of app/views/devise

rails generate devise:views users

Related

Ruby on Rails Devise - Setup - Already Used?

Working through the setup for Devise.
Running
rails generate devise admin
since admin seems to be the user model setup in my app where I now what it to be SSO auth but I get
The name 'Admin' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative or use --skip-collision-check or --force to skip this check and run this generator again.
is it OK to force/ignore this? or ?

Rails 5.1 Installing ActiveAdmin without Devise and a custom User model

So I have a question, about using ActiveAdmin without Devise, the documentation is not clear on this for my needs and I see a lot of people not answering this question clearly. And to be clear, I am using Rails 5.1
To install without using devise you run
rails g active_admin:install --skip-users
In my case, I already have a User class and my own authentication. The docs say:
If you want to use an existing user class, provide it as an argument:
rails g active_admin:install User
this is where the confusion for me lies. Since, I already have a User class and DO NOT want to use Devise, and the generator above does install Devise, would I run
rails g active_admin:install User --skip-users
or
rails g active_admin:install --skip-users
The official documentation states:
After installing the gem, you need to run the generator. Here are your options:
If you don’t want to use Devise, run it with --skip-users:
rails g active_admin:install --skip-users
Further reading:
https://activeadmin.info/0-installation.html#setting-up-active-admin
After that create your own User model, as described in the docs. You can handle authentication as described here:
https://activeadmin.info/1-general-configuration.html#authentication
Normally it incorporates defining some controller method like authenticate_admin_user!.

Ruby on Rails - Devise Views

when we install the gem Devise, the corresponding views are automatically created?
I've installed the gem on an existing model User and it's letting me do the registration and login, but I can't seem to find the folder containing the views...
as it's been said in docs ( https://github.com/plataformatec/devise#configuring-views ), to generate views run:
rails g devise:views user

conflict when generating devise

i'm using Rails 3 with Devise 2.0
i'm using this tutorial User
the problem is :
1- the command
rails generate devise User
doesn't generate the required views and i had to run
rails generate devise_views
in order to generate the views files .. is that wrong ?
2- every thing went correctly and the routes are generated and i can show the
sign in and sign up routes when typing rake routes but
when opening any link like
localhost:3000/users/sign_up
Rails assume that sign_up is the id for the user and shows this message
Showing /Users/wrightgd/.rvm/gems/ruby-1.9.3-p0/gems/devise-1.1.rc0/app/views/devise/sessions/new.html.erb where line #3 raised:
wrong number of arguments (3 for 2)
found answer
i tried to "devise","2.1.2" gem and regenerated the files again it works good , even didn't have to
rails generate devise_views

rails generate devise:views NameError: uninitialized constant View

I have followed the #209 tutorial of railscast http://railscasts.com/episodes/209-introducing-devise?view=asciicast. It was working good until I tried to generate the devise views to customize it (tutorial #210 of railscast)
I did :
rails generate devise:views
rails generate devise_views
Got the following error :
NameError: uninitialized constant View
I am using rails 3.1.3, & devise 1.4.7 with warden 1.0.6.
Any ideas ?
Tks Matt
I ran into this issue myself. I accidentally typed rails g devise views which actually created a new model for devise, and added routes for them. I deleted all of the files that were created, then corrected myself and typed rails g devise:views and started getting your exact error.
After a bit of head scratching I ran a git diff to see if anything else was different, and indeed it had added a route for "views". Upon deleting that route, and running rails g devise:views again, all was well!
Hope this helps!
You can find out a list of all the generators by running rails generate or rails g
The correct generator is:
rails g devise:views
I can only think that you are having some sort of version conflict.
Does the following work:
bundle exec rails g devise:views
If not, have you already run:
rails g devise:install
rails g devise User

Resources