Bendegúz
Bendegúz

Reputation: 766

Allow only the registration form

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

Answers (1)

muttonlamb
muttonlamb

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

Related Questions