Error in Devise Registrations controller with Rails 3.2.13
I get this error when signing up a new user:
ArgumentError (wrong number of arguments (0 for 1)):
app/controllers/devise/registrations_controller.rb:15:in `create'
Is there something wrong with my code?
Code:
class Devise::RegistrationsController < DeviseController
prepend_before_filter :require_no_authentication, :only => [ :new,
:create, :cancel ] prepend_before_filter :authenticate_scope!, :only =>
[:edit, :update, :destroy]
# GET /resource/sign_up def new resource = build_resource({}) respond_with
resource end
# POST /resource def create build_resource
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_up(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
else
set_flash_message :notice,
:"signed_up_but_#{resource.inactive_message}" 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
respond_with resource
end
end
# GET /resource/edit def edit render :edit end
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating
or # modifying a user and when used to authenticate or find a user.
Default is :email. config.strip_whitespace_keys = [ :email ]
# Tell if authentication through request.params is enabled. True by
default. # It can be set to an array that will enable params
authentication only for the # given strategies, for example,
config.params_authenticatable = [:database] will # enable it only for
database (email + password) authentication. config.params_authenticatable
= true
# Tell if authentication through HTTP Basic Auth is enabled. False by
default. # It can be set to an array that will enable http authentication
only for the # given strategies, for example, config.http_authenticatable
= [:token] will # enable it only for token authentication.
config.http_authenticatable = true
# If http headers should be returned for AJAX requests. True by default.
config.http_authenticatable_on_xhr = true
# The realm used in Http Basic Authentication. "Application" by default.
config.http_authentication_realm = "Application"
# It will change confirmation, password recovery and other workflows # to
behave the same regardless if the e-mail provided was right or wrong. #
Does not affect registerable. config.paranoid = true
Thanks, Tony
No comments:
Post a Comment