Skip to content

Instantly share code, notes, and snippets.

@adamakhtar
Created September 1, 2012 05:26
Show Gist options
  • Save adamakhtar/3564542 to your computer and use it in GitHub Desktop.
Save adamakhtar/3564542 to your computer and use it in GitHub Desktop.
#Here we want to include Rails Il8n functionality but since the host is a
#module and modules cant include other modules, we create an Object instanc
#and extend it.
#https://github.com/plataformatec/responders/blob/master/lib/responders/flash_responder.rb
module FlashResponder
class << self
attr_accessor :flash_keys, :namespace_lookup, :helper
end
self.flash_keys = [ :notice, :alert ]
self.namespace_lookup = false
self.helper = Object.new.extend(ActionView::Helpers::TranslationHelper)
...
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment