Permalink
Browse files

Use the action namespace when namespace_lookup is false

  • Loading branch information...
Rafael Mendonça França
Rafael Mendonça França committed Mar 24, 2012
1 parent cfff3ea commit 683da07ae5605110bf02bb11b8d3778aa7b99855
Showing with 8 additions and 1 deletion.
  1. +5 −0 lib/responders/flash_responder.rb
  2. +1 −1 test/flash_responder_test.rb
  3. +2 −0 test/locales/en.yml
@@ -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
@@ -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
@@ -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!"

0 comments on commit 683da07

Please sign in to comment.