Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6722767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:29:11+00:00 2026-05-26T09:29:11+00:00

I have a similar question as Ruby on Rails. Unicode routes but the answer

  • 0

I have a similar question as Ruby on Rails. Unicode routes but the answer marked as working there does not work for me.

I want to have a basic route for a landing page that contains an umlaut (ä). It has to be exactly like that for SEO purposes.

# encoding: UTF-8
Udb::Application.routes.draw do
  get "bonitätsauskunft" => "landing_pages#credit_reference", :as => :lp_credit_reference

When I enter http://localhost/bonitätsauskunft in my browser, I get a routing error No route matches "/bonit%c3%a4tsauskunft". So the query string is not unescaped before matching with the route, which I think is bad, because there are multiple ways to encode umlauts in URLs and I cannot know which one the browser uses.

for example CGI.escape("bonitätsauskunft") # => "bonit%C3%A4tsauskunft", note the capital C3 and A4 instead of c3 and a4 like Firefox sends.

So both get CGI.escape("bonitätsauskunft") and Rack::Utils.escape("bonitätsauskunft") do not match.

I also tried with no luck:

get ":page" => "landing_pages#credit_reference", :as => :lp_credit_reference, :page => /bonitätsauskunft/
get ":page" => "landing_pages#credit_reference", :as => :lp_credit_reference, :constraints => {:page => /bonitätsauskunft/}

The only thing that works for me is the awkward:

# encoding: UTF-8
class UmlautConstraint
  def initialize(page)
    @page = page
  end

  def matches?(request)
    request.params[:page] == @page
  end
end

Udb::Application.routes.draw do
  get ":page" => "landing_pages#credit_reference", :constraints => UmlautConstraint.new("bonitätsauskunft")
  get "bonitätsauskunft" => "landing_pages#credit_reference", :as => :lp_credit_reference

The second route, of course, is needed so I can use a named route to create links like link_to("Bonitätsauskunft", :lp_credit_reference) because Rails would not know how to satisfy the UmlautConstraint.

Isn’t there a normal and easy way to do this? I really thought rails 3 would be better with internationalization by now.

Rails 3.0.10, Ruby 1.9.2, Apache2 with passenger 3.0.7.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:29:12+00:00Added an answer on May 26, 2026 at 9:29 am

    Use your first idea with CGI.escape("bonitätsauskunft").downcase

    It will work with any browser. It don’t depend on browser encoding, but SERVER encoding. When you use another server (webrick), routes could need to be changed.

    I’m using this type of “unicode” routes successfully for some time and it really has good SEO effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a similar question about 'bson_ext', but it's not work for me. MongoMapper
I have a similar question than django cross-site reverse . But i think I
I have asked a similar question before, but I didn't have a firm grasp
I made a similar question a few days ago, but now I have new
I'm using Rails 3.2 (not a ruby on rails question) and coming close to
Ok, there are similar question about this but I'm going a little bit further.
I am working on a Ruby on Rails site that is going to have
Question 828421 asked similar question, but received only one real answer (update rubygems) and
I'm working on a Ruby on Rails project where I have a post model
I have a similar question to this one SQL products/productsales I want to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.