Rails: Devise custom create registration -
There is a custom registration in my plan, but it is not doing what I should do.
I am trying to create new data:
def create_resource (sign_up_params) if resource.save yield resource if block_given? What is resource.active_for_authentication? Set_flash_message: Notice ,: if_flashing_format is signed? Sign_up (resource_name, processing) response_with resource ,: location = & gt; Parameter [: User] [: Role] == "Proof" proof .create (: user_id = & gt; current_user.id, first_name = & gt; Parameters [: user] [: first_name],: last_name = & gt; Parameter [: User] [: Last_Name]) End and Set_flight_mail: Android, Notice, "signed_up_butt_ #info_flashing_format" # expired_data_after_sign_in! Reply with Resource: Location = & gt;
What is the custom of this part:
if parameter [: user] [: role] =) = "proof" proof.cent (: User_ id = & gt; current_user.id,: first_name = & gt; parameters [: user] [: first_name],: last_name = & amp;; parameter [: user] [: last_name]) end
But for some reason, it should not be done which is considered to be about it, it will not create new data in my database. Is this a wrong place where it should go?
Parameter: {"utf8" => "✓", "Authenticity_token" = & gt; "3QTVW3x3cnWho5yd6aEMC31iDIDu + IHQClpQao9VBqc =", "user" = & gt; {"First_name" = & gt; "first", "last_name" = & gt; "final", "role" = & gt; "proof"}}
in create
action, swap
response_with resource, location => Parameters [= User] [: Role] == "Proof" proof .create (: user_id = & gt; current_user.id ,: first_name = & gt; Parameters [: user] [: first_name],: last_name = [parameter [ : User] [: role] == "proof" proof.cent (user] [: last_name])
for
if parameter [: user] [: role] == : User_id = & gt; current_user.id ,: first_name = & gt; parameters [: user] [: first_name],: last_name => parameter [: user] [: last_name]> gt; < / Pre> currently
record if
as the code from the statement The code is not found and it is never executed. When you call the response_with
method, the method create
returns if
Before calling, answer_multiple
calls should resolve your problem.
According to UPDATE
Chat with OP Session, proof
record custom_url
field was not being due to a validation change the verification with the on :: update
option Regions is suggested.
Valid: custom_url, Specification: True: On:
Comments
Post a Comment