How to get the "#" symbol in the :id into the redirect_to method in Rails
- by Matthias Günther
Hello,
this is a silly questions but I don't understand, why rails isn't evaluating my string as expected. Here is my problem:
I want to redirect to an url in the form ~/:controller/index/#_76
redirect_to :action => "index", :id => '#_76'
But I'm getting the url in the form: ~/:controller/index/%25_76 and so my anchor for linking to a certain place in the website isn't working. Can someone please explain me, why rails makes this rendering? I think this hase something to do with url encoding.
Again thanks for your help, I'm learning every day a little bit more about rails :).