Thank you, you are really right I should put it in my
application_helper. But Here we will have a lot of projets and I want
to share this kind of changes to all teams. So that's why I would like
to ultimatly put it in a gem.
So I'm curious to see how you would include mymodule on
ActionView::Base.
Thank you, you are really right I should put it in my
application_helper. But Here we will have a lot of projets and I want
to share this kind of changes to all teams. So that's why I would like
to ultimatly put it in a gem.
So I'm curious to see how you would include mymodule on
ActionView::Base.
ActionView::Base.send :include, MyModule
With a plugin you'd typically put this in the plugin's init.rb
Will all the pictures on the site be localized?
Probably not - maybe it would be better if you create a method called
something like
image_localized_tag
in your application helper. It could take "locale" from cookie and
change passed file name (locale isn't parameter now).
After changing the name it could just call image_tag and return the
result.
This is just a suggestion - IMHO it's easier to implement and cleaner
later on for other developers - some of them may expect different
behaviour from image_tag