I want to show a flash notice in my Rails app all the time unless only certain attributes are updated.
def update
if @user.update_attributes(user_params)
if user_params == [:user][:certain_params]
redirect_to users_path
else
redirect_to users_path, notice: "#{@user.name} saved."
end
else
redirect_to edit_user_path(@user), flash: { error: @user.mapped_errors }
end
end
Something like this pseudocode?