Skip to content

Commit

Permalink
Merge pull request heartcombo#5416 from DerekCrosson/main
Browse files Browse the repository at this point in the history
Make copying and pasting terminal commands easier
  • Loading branch information
rafaelfranca authored Jun 9, 2023
2 parents 1b0ef1d + 1ac16b1 commit ec06745
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bundle add devise
Next, you need to run the generator:

```console
$ rails generate devise:install
rails generate devise:install
```

At this point, a number of instructions will appear in the console. Among these instructions, you'll need to set up the default URL options for the Devise mailer in each environment. Here is a possible configuration for `config/environments/development.rb`:
Expand All @@ -196,7 +196,7 @@ The generator will install an initializer which describes ALL of Devise's config
In the following command you will replace `MODEL` with the class name used for the application’s users (it’s frequently `User` but could also be `Admin`). This will create a model (if one does not exist) and configure it with the default Devise modules. The generator also configures your `config/routes.rb` file to point to the Devise controller.

```console
$ rails generate devise MODEL
rails generate devise MODEL
```

Next, check the MODEL for any additional configuration options you might want to add, such as confirmable or lockable. If you add an option, be sure to inspect the migration file (created by the generator if your ORM supports them) and uncomment the appropriate section. For example, if you add the confirmable option in the model, you'll need to uncomment the Confirmable section in the migration.
Expand Down Expand Up @@ -368,22 +368,22 @@ We built Devise to help you quickly develop an application that uses authenticat
Since Devise is an engine, all its views are packaged inside the gem. These views will help you get started, but after some time you may want to change them. If this is the case, you just need to invoke the following generator, and it will copy all views to your application:

```console
$ rails generate devise:views
rails generate devise:views
```

If you have more than one Devise model in your application (such as `User` and `Admin`), you will notice that Devise uses the same views for all models. Fortunately, Devise offers an easy way to customize views. All you need to do is set `config.scoped_views = true` inside the `config/initializers/devise.rb` file.

After doing so, you will be able to have views based on the role like `users/sessions/new` and `admins/sessions/new`. If no view is found within the scope, Devise will use the default view at `devise/sessions/new`. You can also use the generator to generate scoped views:

```console
$ rails generate devise:views users
rails generate devise:views users
```

If you would like to generate only a few sets of views, like the ones for the `registerable` and `confirmable` module,
you can pass a list of views to the generator with the `-v` flag.

```console
$ rails generate devise:views -v registrations confirmations
rails generate devise:views -v registrations confirmations
```

### Configuring controllers
Expand All @@ -393,7 +393,7 @@ If the customization at the views level is not enough, you can customize each co
1. Create your custom controllers using the generator which requires a scope:

```console
$ rails generate devise:controllers [scope]
rails generate devise:controllers [scope]
```

If you specify `users` as the scope, controllers will be created in `app/controllers/users/`.
Expand Down

0 comments on commit ec06745

Please sign in to comment.