Skip to content

Commit

Permalink
Update README with route override instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
derekprior committed Oct 17, 2014
1 parent 2a09afe commit d88308a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Clearance.configure do |config|
config.cookie_domain = '.example.com'
config.cookie_expiration = lambda { |cookies| 1.year.from_now.utc }
config.cookie_path = '/'
config.routes = true
config.httponly = false
config.mailer_sender = 'reply@example.com'
config.password_strategy = Clearance::PasswordStrategies::BCrypt
Expand Down Expand Up @@ -151,13 +152,17 @@ end
Overriding routes
-----------------

See [config/routes.rb](/config/routes.rb) for the default behavior.
See [config/routes.rb](/config/routes.rb) for the default set of routes.

To override a Clearance route, redefine it:
Route overrides became more difficult with [changes made in Rails
4][rails_routes]. For this reason, Clearance 1.5 introduces an option to disable
all clearance routes, giving the user full control over routing and URL design.

```ruby
resource :session, controller: 'sessions'
```
To disable the routes, set `config.routes = false`. You can optionally run
`rails generate clearance:routes` to dump a copy of the default routes into your
application for modification.

[rails_routes]: https://github.com/rails/rails/issues/11895

Overriding controllers
----------------------
Expand All @@ -173,7 +178,7 @@ class SessionsController < Clearance::SessionsController
class UsersController < Clearance::UsersController
```

Don't forget to override routes to your new controllers!
Don't forget to [override routes](#overriding-routes) to your new controllers!

Then, override public methods:

Expand Down Expand Up @@ -235,8 +240,8 @@ default behavior.
Overriding layouts
----------------

By default, Clearance uses your application's default layout. If you would like
to change the layout that Clearance uses when rendering its views, simply specify
By default, Clearance uses your application's default layout. If you would like
to change the layout that Clearance uses when rendering its views, simply specify
the layout in an initializer.

```ruby
Expand Down

0 comments on commit d88308a

Please sign in to comment.