0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

登録したプロフィールの入力データ編集時にパスワード認証なしでUPDATEする方法

Posted at

#はじめ
HTMLやHAMLでCURRENT PASSWORDに入力を省くはまずだが、それ以外にやるべきことが次にあります。

#1.

registration_controller.rb
class RegistrationsController < Devise::RegistrationsController
  protected
    def update_resource(resource, params)
      resource.update_without_password(params)
    end
end

2.controllers: {registration: 'registrations'}

routes.rb
Rails.application.routes.draw do
  root 'pages#home'
  
  devise_for :users,
             path: '',
             path_names: {sign_in: 'login', sign_out: 'logout', edit:'profile', sign_up: 'registration'},
             controllers: {registration: 'registrations'}

  resources :users, only: [:show]
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?