Class: Credentials::NameController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Credentials::NameController
- Defined in:
- app/controllers/credentials/name_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /credentials/name/create.
-
#delete ⇒ Object
GET /credential/name/:name_credential_id/delete.
-
#destroy ⇒ Object
POST /credential/email/:email_credential_id/destroy.
-
#edit_password ⇒ Object
GET /credential/name/:name_credential_id/edit_password.
-
#new ⇒ Object
GET /credentials/name/new.
-
#update_password ⇒ Object
POST /credential/name/:name_credential_id/update_password.
Instance Method Details
#create ⇒ Object
POST /credentials/name/create
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/credentials/name_controller.rb', line 16 def create @edit_form = NameCredentialEditForm.new(params[:edit_form]) @name_credential = @login_user.name_credentials.build @name_credential.attributes = @edit_form.to_name_credential_hash if @edit_form.valid? && @name_credential.save # メール送信はしない set_notice(p_("MultiAuth", "Name authentication credential was successfully added.")) redirect_to(credentials_path) else @edit_form.password = nil @edit_form.password_confirmation = nil set_error_now(p_("MultiAuth", "Please confirm your input.")) render(:action => "new") end end |
#delete ⇒ Object
GET /credential/name/:name_credential_id/delete
57 58 59 |
# File 'app/controllers/credentials/name_controller.rb', line 57 def delete # nop end |
#destroy ⇒ Object
POST /credential/email/:email_credential_id/destroy
62 63 64 65 66 67 |
# File 'app/controllers/credentials/name_controller.rb', line 62 def destroy @name_credential.destroy set_notice(p_("MultiAuth", "Name authentication credential was successfully deleted.")) redirect_to(:controller => "/credentials") end |
#edit_password ⇒ Object
GET /credential/name/:name_credential_id/edit_password
35 36 37 |
# File 'app/controllers/credentials/name_controller.rb', line 35 def edit_password @edit_form = PasswordEditForm.new end |
#new ⇒ Object
GET /credentials/name/new
11 12 13 |
# File 'app/controllers/credentials/name_controller.rb', line 11 def new @edit_form = NameCredentialEditForm.new end |
#update_password ⇒ Object
POST /credential/name/:name_credential_id/update_password
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/credentials/name_controller.rb', line 40 def update_password @edit_form = PasswordEditForm.new(params[:edit_form]) @name_credential.attributes = @edit_form.to_credential_hash if @edit_form.valid? && @name_credential.save set_notice(p_("MultiAuth", "Password was changed.")) redirect_to(:controller => "/credentials") else @edit_form.password = nil @edit_form.password_confirmation = nil set_error_now(p_("MultiAuth", "Please confirm your input.")) render(:action => "edit_password") end end |