Ruby on Rails. Unicode routes -
Ruby on Rails. Unicode routes -
is possible set unicode string segment of path in rails?
i seek following:
# app/controllers/magazines_controller.rb class magazinescontroller < applicationcontroller def index end end # encoding: utf-8 # config/routes.rb publishinghouse::application.routes.draw resources :magazines, :only => :index, :path => :журналы # unicode string set segment of path end $ rake routes magazines /журналы(.:format) {:action=>"index", :controller=>"magazines"} but when go path routing error:
$ w3m http://localhost:3000/журналы ... routing error no route matches "/%d0%b6%d1%83%d1%80%d0%bd%d0%b0%d0%bb%d1%8b"here's server log:
$ rails s lean ... started "/%d0%b6%d1%83%d1%80%d0%bd%d0%b0%d0%bb%d1%8b" 127.0.0.1 @ 2010-09-26 13:35:00 +0400 actioncontroller::routingerror (no route matches "/%d0%b6%d1%83%d1%80%d0%bd%d0%b0%d0%bb%d1%8b"): rendered /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.2ms)thanks.
debian gnu/linux 5.0.6;
ruby 1.9.2;
ruby on rails 3.0.0.
intereting, think rails need patch this. shall speak core later. in meantime, next should work:
publishinghouse::application.routes.draw resources :magazines, :only => :index, :path => rack::utils.escape('журналы') # unicode string set segment of path end ruby-on-rails ruby unicode routes
Comments
Post a Comment