francesc / rails-translate-routes

MIT License
147 stars 50 forks source link

Conflict with Refinery CMS #13

Open eltercero opened 12 years ago

eltercero commented 12 years ago

Since refinery has this:

mount Refinery::Core::Engine, :at => '/'

I had to declare the front routes before that like this:

App::Application.routes.draw do
  # Frontend routes
  namespace :refinery, :path => "" do
    namespace :success_stories do
      resources :success_stories, :path => '', :only => [:index, :show]
    end
  end  
end

ActionDispatch::Routing::Translator.translate_from_file('config/locales/routes.yml')

App::Application.routes.draw do
  mount Refinery::Core::Engine, :at => '/'
end

And it works perfect, I can access model with the translations and everything. The problem is that the url methods aren't working at all:

undefined method `refinery_clients_client_es_url' for #<#<Class:0x0000010a260d80>:0x0000010b101088>

But rake routes show me that link like it's ok:

 refinery_clients_client_es GET    /clientes/:id(.:format)                                                 refinery/clients/clients#show {:locale=>"es"}

I guess it's not reaching the translation from the Refinery engine, but I don't know how to make it work.

Thanks!

itschn commented 10 years ago

1+