lib/generators/authentication/templates/controllers/html/password_resets_controller.rb.tt in authentication-zero-0.0.12 vs lib/generators/authentication/templates/controllers/html/password_resets_controller.rb.tt in authentication-zero-0.0.13
- old
+ new
@@ -17,11 +17,11 @@
redirect_to new_password_resets_path, alert: "The email address doesn't exist in our database"
end
end
def update
- if @<%= singular_table_name %>.update(password_params)
+ if @<%= singular_table_name %>.update(<%= "#{singular_table_name}_params" %>)
redirect_to sign_in_path, notice: "Your password was reset successfully. Please sign in"
else
render :edit, status: :unprocessable_entity
end
end
@@ -31,9 +31,9 @@
@<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:sid], purpose: "password_reset")
rescue ActiveSupport::MessageVerifier::InvalidSignature
redirect_to new_password_resets_path, alert: "Your token has expired, please request a new one"
end
- def password_params
+ def <%= "#{singular_table_name}_params" %>
params.require(:<%= singular_table_name %>).permit(:password, :password_confirmation)
end
end