Closed woller closed 2 years ago
I had misdiagnosed the problem. When I called RodauthApp.rodauth(:admin).create_account(rodauth_admin_params)
, I got a warning and then an error
unhandled options passed to create_account: {"name"=>"Erik Eriksen", "phone"=>"22334455"}
Rodauth::InternalRequestError: There was an error creating your account ({"name"=>"must be present"})
Turns out I needed to call create_account
with params as a keyword:
RodauthApp.rodauth(:admin).create_account(params: rodauth_admin_params)
Now everything works as expected.
Hi and thanks for a great gem.
I am currently using this gem to implement a couple of different user types in an app, where account creation is done entirely in the back end. In my accounts table, I have a couple of extra fields (
phone
andname
).I currently have this implementation, but it both costs an extra query and comes with a risky race condition.
In the rodauth documentation I found this guide explaining how to send extra params during account creation: http://rodauth.jeremyevans.net/rdoc/files/doc/guides/registration_field_rdoc.html#top Specifically this seems to be the solution to my problem:
But I cannot figure out where to do this in rodauth-rails.
The configuration for my admin account looks like this: