Skip to content

Instantly share code, notes, and snippets.

@christopherdbull
Created November 15, 2011 05:21
Show Gist options
  • Save christopherdbull/1366236 to your computer and use it in GitHub Desktop.
Save christopherdbull/1366236 to your computer and use it in GitHub Desktop.
def create
build_resource
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_in(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
else
set_flash_message :notice, :inactive_signed_up, :reason => inactive_reason(resource) if is_navigational_format?
expire_session_data_after_sign_in!
respond_with resource, :location => after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords(resource)
puts resource.inspect
respond_with_navigational(resource) { render_with_scope :new }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment