Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vincentopensourcetaiwan/3174002 to your computer and use it in GitHub Desktop.
Save vincentopensourcetaiwan/3174002 to your computer and use it in GitHub Desktop.
Devise before filter that prevents access to “new_user_registration_path” unless user is signed-in
#/ app / controllers / registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
before_filter :authenticate_user!
end
#/ config / routes.rb
devise_for :users, :controllers => { :registrations => 'registrations'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment