Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better documentation on customizing controllers/actions/routes

  • Loading branch information...
commit 9b091f5f53e362e5e10f336df0fc5453d7e6ef75 1 parent d2c3298
@croaky croaky authored
Showing with 15 additions and 3 deletions.
  1. +15 −3 README.md
View
18 README.md
@@ -8,8 +8,8 @@ Rails authentication with email & password.
Help
----
-* [#thoughtbot](irc://irc.freenode.net/thoughtbot) IRC channel on freenode
* [documentation](http://rdoc.info/projects/thoughtbot/clearance)
+* [#thoughtbot](irc://irc.freenode.net/thoughtbot) IRC channel on freenode
* [mailing list](http://groups.google.com/group/thoughtbot-clearance)
Bugs, Patches
@@ -51,14 +51,26 @@ method in a before_filter.
end
end
-Subclass and override any Clearance-provided controller as needed:
+Customizing
+-----------
+
+To change any of provided actions, subclass a Clearance controller...
class SessionsController < Clearance::SessionsController
+ def new
+ # my special new action
+ end
def url_after_create
- new_blog_post_path
+ my_special_path
end
end
+and add your route above (before) Clearance routes in config/routes.rb:
+
+ map.resource :session, :controller => 'clearance/sessions'
+
+See lib/clearance/routes.rb for all the routes Clearance provides.
+
Actions that redirect (create, update, and destroy) in Clearance controllers
can be overriden by re-defining url_after_(action) methods as seen above.
Please sign in to comment.
Something went wrong with that request. Please try again.