Since errors.full_messages is an array, the flash message is output as ["hoge hoge"] → I want to change it to characters and output hogehoge
Just add the to_sentence method to errors.full_messages
user_contorller.rb
class Users::UserController < Users::ApplicationController
#Omission
def update
@user = user.Users
flash[:alert] = @user.errors.full_messages.to_sentence
end
#Omission
end
Thank you for your hard work today.
Recommended Posts