Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the action namespace when namespace_lookup is false

  • Loading branch information...
commit 683da07ae5605110bf02bb11b8d3778aa7b99855 1 parent cfff3ea
@rafaelfranca rafaelfranca authored
View
5 lib/responders/flash_responder.rb
@@ -180,7 +180,12 @@ def flash_defaults_by_namespace(status) #:nodoc:
slices.shift
end while slices.size > 0 && lookup
+ action_scope = :"flash.actions.#{controller.action_name}.#{status}"
+ defaults << :"#{action_scope}_html"
+ defaults << action_scope
+
defaults << ""
+ defaults.uniq
end
end
end
View
2  test/flash_responder_test.rb
@@ -210,6 +210,6 @@ def test_fallbacks_to_non_namespaced_controller_flash_message
def test_does_not_fallbacks_to_non_namespaced_controller_flash_message_if_disabled
delete :destroy
- assert_equal nil, flash[:notice]
+ assert_equal "Resource was successfully destroyed.", flash[:notice]
end
end
View
2  test/locales/en.yml
@@ -9,6 +9,8 @@ en:
with_html:
failure_html: "<strong>OH NOES!</strong> You did it wrong!"
xss_html: "<strong>Yay!</strong> %{xss}"
+ destroy:
+ notice: 'Resource was successfully destroyed.'
addresses:
update:
success: "Nice! %{resource_name} was updated with success!"
Please sign in to comment.
Something went wrong with that request. Please try again.