Created
September 23, 2010 18:15
-
-
Save nordringrayhide/594079 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Signup::CustomersController < ApplicationController | |
inherit_resources | |
defaults :resource_class => User, :collection_name => 'users', :instance_name => 'user' | |
actions :new, :create | |
def create | |
create! do |success, failure| | |
success.html do | |
resource.roles |= [Role.find_by_name('customer')] | |
flash[:notice] = "Customer #{resource.name} successfuly registered" | |
sign_in(resource) | |
redirect_to root_path | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment