Reputation: 766
How can I create a method that will navigate the visitors to a registration path before (s)he signs in or signs up?
Upvotes: 0
Views: 44
Reputation: 6501
Use a before_filter on your controllers to ensure that users are signed in, with the default action of redirect to registration if they are not.
There is a Gem called Devise which is very useful for authentication and is well worth the effort of learning it.
Another good place to go is http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
This will give you an excellent grounding in Rails
Upvotes: 2