Skip to content

Instantly share code, notes, and snippets.

@mattjstar
Last active August 29, 2015 14:06
Show Gist options
  • Save mattjstar/9ad51ee17a7082021482 to your computer and use it in GitHub Desktop.
Save mattjstar/9ad51ee17a7082021482 to your computer and use it in GitHub Desktop.
Devise Override
# routes.rb
devise_for :users, :path => '', :path_names => {:sign_in => 'login', :sign_out => 'logout'}, :controllers => { :registrations => 'registrations', :sessions => 'sessions' }
# registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
def create
if the token is present?
resource.user_group_id = #usergroupid
end
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment