Class: Hello::Management::PasswordsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Hello::Management::PasswordsController
- Defined in:
- app/controllers/hello/management/passwords_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET /hello/passwords.
-
#show ⇒ Object
GET /hello/passwords/1.
-
#update ⇒ Object
PATCH /hello/passwords/1.
Instance Method Details
#index ⇒ Object
GET /hello/passwords
13 14 15 16 17 18 |
# File 'app/controllers/hello/management/passwords_controller.rb', line 13 def index respond_to do |format| format.html { redirect_to password_path(@password_credential.id) } format.json { head :no_content } end end |
#show ⇒ Object
GET /hello/passwords/1
21 22 23 24 25 26 |
# File 'app/controllers/hello/management/passwords_controller.rb', line 21 def show respond_to do |format| format.html { render_password_view } format.json { head :no_content } end end |
#update ⇒ Object
PATCH /hello/passwords/1
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/hello/management/passwords_controller.rb', line 29 def update @password_credential.password = password_credential_params[:password] # @password_credential.password_confirmation = password_credential_params[:password_confirmation] if password_credential_params[:password_confirmation] if @password_credential.save respond_to do |format| format.html { redirect_to hello.password_path(@password_credential), notice: @update_profile. } format.json { head :no_content } end else respond_to do |format| format.html { render_password_view } format.json { render json: @password_credential.errors, status: :unprocessable_entity } end end end |