We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have added the following test:
def test_route_with_mandatory_format draw_routes do localized do get 'people.:format', :to => 'people#index' end end assert_routing '/es/gente.xml', :controller => 'people', :action => 'index', :format => 'xml', :locale => 'es' assert_routing '/people.xml', :controller => 'people', :action => 'index', :format => 'xml', :locale => 'en' end
It fails with
TranslateRoutesTest#test_formatted_route [/home/vk/route_translator/test/routing_test.rb:297]: No route matches "/es/gente.xml"
(The same for /people.xml - no route matches).
/people.xml
But if I change .:format to (.:format) it works.
.:format
(.:format)
The text was updated successfully, but these errors were encountered:
I did some investigation and it looks like that when you do unlocalized:
get 'people.:format', :to => 'people#index'
it generates route GET /people.:format people#index (as shown in rake routes).
GET /people.:format people#index
rake routes
But when you do localized:
localized do get 'people.:format', :to => 'people#index' end
It generates the routes without :format!
:format
GET /es/people people#index {:locale=>"es"} GET /people people#index {:locale=>"en"}
Sorry, something went wrong.
I made a pull request #58 to fix this.
The pull request is merged, thanks. I just released route_translator 3.2.3 that include your fix.
No branches or pull requests
I have added the following test:
It fails with
(The same for
/people.xml
- no route matches).But if I change
.:format
to(.:format)
it works.The text was updated successfully, but these errors were encountered: