This project is archived and is in readonly mode.

#4453 ✓stale
Joern Akkermann

http request values converted wrong in special case

Reported by Joern Akkermann | April 22nd, 2010 @ 08:35 AM

Hi,

I'm using Rails 2.3.4.

Following situation:
You have a call like "/books/show?name=the+name"
as you can see the space between "the" and "name" is correctly replaced by a "+"
now you change the route to "/:name" and create a link_to "example", :controller => :books, :action => :show, :name => "the name"
and you get "/the name" without the space replaced.
That's wrong I think!? It should also be replaced by a "+".

If it is not clear: it is only the case if you rename a route like I did above.

Edit: The Problem is: Rails should generate a valid and working url, an url like "/the name" is equivalent to "/the", that's no good deal. Rails should convert all chars of the passed vars the way like chars are always converted for urls. If a space becomes a "%20" or "+" doesn't matter but there are often many chars that need to be converted. At least we need something like h() for urls.

Yours Joern.

Comments and changes to this ticket

  • Jeff Kreeftmeijer

    Jeff Kreeftmeijer April 22nd, 2010 @ 09:29 AM

    If you do this;

    link_to "example", :controller => :books, :action => :show, :name => "the name"
    

    You're specifically passing the string "the name". I don't think rails should replace that space with a '+', since you specified you wanted a space there.

    And, what do you mean by "You have a call like "/books/show?name=the+name""? I don't really understand what you're talking about.

    I think this one is invalid, but we probably need more info...

  • Ryan Bigg

    Ryan Bigg April 22nd, 2010 @ 11:51 AM

    • State changed from “new” to “needs-more-info”

    What bug is this causing? If it's just "the URL doesn't look pretty" then that's not a Rails issue.

  • Joern Akkermann
  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:43 PM

    • State changed from “needs-more-info” to “open”
    • Importance changed from “” to “Low”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:43 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages