Skip to content

Commit

Permalink
improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
francesc committed Jan 4, 2012
1 parent 1e93b70 commit 10284c1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,29 @@ A simple example of a redirection to user locale in index method:
# rest of the controller logic ...
end

<b>Namespaced backends</b>

I usually build app backend in namespaced controllers, routes, ... using 'prefix_on_default_locale' will result in having several routes for backend too, for example:

/en/admin/products
/es/admin/productos

In most cases you won't want to have the backend in several languages, you can set 'routes.rb' this way:

SampleApp::Application.routes.draw do
resources :products
match 'contact', :to => 'pages#contact'
end

ActionDispatch::Routing::Translator.translate_from_file('config/locales/routes.yml', { :prefix_on_default_locale => true })

SampleApp::Application.routes.draw do
namespace :admin do
resources :products
root :to => "admin_products#index"
end
end

== TODO

Help is welcome ;)
Expand Down

0 comments on commit 10284c1

Please sign in to comment.