Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Doc needs: How to save @user correctly #14

Open
audreylee88 opened this Issue · 0 comments

1 participant

@audreylee88

Hi there,

I need help writing the create() method in the users_controller.

So perhaps this could label this as a "documentation bug".

Anyway, in my users controller, I wrote this:

def create
@user = User.new(params[:user])
debugger
@user.save do |result|
if result
flash[:notice] = "Account registered!"
redirect_back_or_default account_url
else
render :action => :new
end
end
end

When control hits

@user.save do |result|

control transfers to this file:

http://github.com/binarylogic/authlogic_openid/blob/master/lib/authlogic_openid/acts_as_authentic.rb

then to this line:

def save(perform_validation = true, &block)
return false if perform_validation && block_given? && authenticate_with_openid? && !authenticate_with_openid

Once here, the debugger is telling me that block_given? is false.

This is wrong.

block_given? should be true.

So, perhaps I wrote create() incorrectly?

The doc only gives syntax for the saving of UserSession objects.

Please offer clues.

Thanks,
--Audrey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.