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 808539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:34:38+00:00 2026-05-15T00:34:38+00:00

this is a silly questions but I don’t understand, why rails isn’t evaluating my

  • 0

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 :).

  • 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-15T00:34:38+00:00Added an answer on May 15, 2026 at 12:34 am

    So your aim is not to “get the “#” symbol into URL”. In this you have succeeded: you’ve been returned a URL with “#” character encoded into it.

    What you need is “redirecting to a specific anchor”. You don’t need to do hacky tricks to bring it into the URL:

    redirect_to :action => "index", :anchor => "_76"
    

    Most likely you would want to detach :id from index action, because index is the page specific to the controller as a whole, not for each particular item.

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

Sidebar

Related Questions

Ok so this maybe a simple/silly question but I don't know so here goes:
Excuse me if this is a silly question but i'm a beginer here. I
This is an admittedly silly question, but I honestly don't know if this is
Maybe the question sounds silly, but I don't understand 'something about threads and locking
This might seem like a silly question, but after asking some questions on stackoverflow
Maybe this question is silly but I really don't know how to solve. First,
this is a silly n00b question but i just don't get it to work.
I've seen a lot of similar questions, but I don't think I'm duplicating. Here's
Forgive me if this is a silly question but I'm afraid that I don't
Sorry, this questions sounds silly, but after developing some of my RESTful services using

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.