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

  • Home
  • SEARCH
  • 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 7887579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:37:00+00:00 2026-06-03T05:37:00+00:00

In the last we generated a useful link for our mail. generate an real

  • 0

In the last we generated a useful link for our mail.
generate an real url with rails for an e-mail
This works fine, very fine. But we want to call the shoe-action 🙂

<%=link_to('Link', :controller => 'mycontroller', :action => 'show', :id => @mycontroller.id )%> 

The url looks so

http://localhost:3000/mycontroller/show/10

we need this structure

http://localhost:3000/mycontroller/10

The rake routes command said this

mycontroller GET    /mycontroller/:id(.:format)               mycontroller#show

How do we get the needed structure? Do we need to edit our routes, or is there another way to get the right url?

  • 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-06-03T05:37:02+00:00Added an answer on June 3, 2026 at 5:37 am

    Try to use the route helper

      mycontroller_url(@mycontroller.id)
    

    instead the {:controller => …, :action => …}

    your link_to helper should look like this for better example i use the user show action

    rake routes return this

    user GET  /users/:id(.:format) users#show
    

    and now I know I can use the user_url(@user) helper

    <%=link_to('Link', user_url(@user) )%> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code is not pretty, but I want to print out the last generated
In the last week I generated a SSH id_rsa key on my localhost that
Last Thursday we just released a new version of our website. The big change
Last year I developed a data access service for our project using Entity Framework
Last evening I did some housekeeping on our code repository - basically moved the
Last night I think I did something that hosed my rails development environment, and
I use this class (taken from a blog tutorial) to generate unique keys to
Is it possible to generated a Print When Expression that detects the last element
I have a very basic question how the creation of HTTPSession works.I know you
Can I make an internally generated certificate/key last longer than 12 months?

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.