You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably the expected behavior, but it's less than ideal. When setting a flash within success/failure blocks, the flash is added to the flash that's automatically set by inherited_resources. I think a better behavior would be to only automatically add a flash if one was not explicitly set in the success/failure block. For example, in the following code I would expect one flash, but end up with two:
def update
update! do |success, failure|
success.html do
flash[:success] = 'Your account has been updated.'
redirect_to account_path
end
end
end
The text was updated successfully, but these errors were encountered:
Although I know it's lame on my part, I'm afraid I don't know how to. :( I need to get up to speed on Rails TDD/rspec/etc, but won't get to that within any reasonable time.
This is probably the expected behavior, but it's less than ideal. When setting a flash within success/failure blocks, the flash is added to the flash that's automatically set by inherited_resources. I think a better behavior would be to only automatically add a flash if one was not explicitly set in the success/failure block. For example, in the following code I would expect one flash, but end up with two:
def update
update! do |success, failure|
success.html do
flash[:success] = 'Your account has been updated.'
redirect_to account_path
end
end
end
The text was updated successfully, but these errors were encountered: