Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
Fix edit bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryuto Kawano committed Oct 12, 2018
1 parent 9b190c7 commit 65f4955
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def edit
end

def update
if @user.update(user_params)
if @user.update_attributes(user_params)
flash[:success] = "更新しました"
redirect_to @user
else
Expand Down
5 changes: 3 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ class User < ApplicationRecord
#validates :email, {presence: true, uniqueness: true}
validates :password,
confirmation: true,
presence: { message: 'を入力してください'}

presence: { message: 'を入力してください'},
allow_nil: true

has_many :ideas, dependent: :destroy
has_many :topics, dependent: :destroy
has_many :likes, dependent: :destroy
Expand Down

0 comments on commit 65f4955

Please sign in to comment.