Closed jerefrer closed 12 years ago
Try to use: Rails.application.routes.url_helpers.articles_en_path
Yep it's working.
But this way the route will always be the english one won't it ?
Aren't we losing the main point of your gem (transparent simplicity !) if we need to specify the language ?
Hey,
In a model you can access the I18n.locale so you can make a work-around:
eval("Rails.application.routes.urlhelpers.articles#{I18n.locale.to_s}_path")
I agree it's not the best way, but take into account that 99% of time you don't use url helpers on models so I thinks it's a worth price to pay being able to have the other features of the gem.
Ouch! Got hit by this after upgrading to Rails 4 (everything was working nice on Rails 3.2). This is not very obvious and was kind of hard to debug ... do you think we can reopen this issue and work on a fix?
My main use case is for service objets (PORO) connecting to external APIs (payment processors, for instance).
In some models i'm using
But after installing the gem I had this error :