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

The Archive Base Latest Questions

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

I’m trying to get this link: <%= link_to(‘Edit’, :action => ‘manage’, :id => user)

  • 0

I’m trying to get this link:

<%= link_to('Edit', :action => 'manage', :id => user) %>

even tried explicitly <%= link_to(‘Edit’, {:controller => ‘users’, :action => ‘manage’, :id => user}, :method => :get) %>

to show the link in HTML as

 '/users/manage/1' or '/users/1/manage'

but it shows up as

'/users/manage?id=1'

I can see in my routes:

manage_users GET    /users/manage(.:format)            {:action=>"manage", :controller=>"users"}
...
edit_user GET    /users/:id/edit(.:format)          {:action=>"edit", :controller=>"users"}

so I added a map.connect, but it was added to users

users    GET    /users/manage/:id(.:format)        {:action=>"manage", :controller=>"users"}

but without any success. The link is still ‘/users/manage?id=1’

This doesn’t work anymore than the above.

GET    /users/:id/manage(.:format)        {:action=>"manage", :controller=>"users"}

Now, when I put the :action in link_to, to ‘edit’ i.e.

<%= link_to('Edit', :action => 'edit', :id => user) %>

The routes.rb edit_user GET /users/:id/edit/(.:format) works, with a link showing up of

'/users/1/edit'

How do I get my link_to to show the same link when it is ‘manage’ instead of ‘edit’, i.e. showing a link of ‘users/1/manage’ instead of ‘/users/manage?id=1’??? Is it because my above map.connect is being added to users, when it should be added to ‘manage_users’?

Thank for the help. I’ll be trying to figure it out.

Peace.

BTW, /users/manage?id=1 works, I just want the proper rewrite link to click on.

EDIT routes.rb

map.resources :users, :collection => {:manage => :get}

#map.manage_user '/users/:id/manage', :controller => :users, :action => :manage
#map.resources :users, :member => { :manage  => :get } 
#map.connect 'users/manage/:id(.:format)', :controller => 'users', :action => 'manage',  :conditions => { :method => :get }

map.resources :categories
map.resources :posts
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
  • 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-15T16:38:55+00:00Added an answer on May 15, 2026 at 4:38 pm

    so I added a map.connect, but it was added to users
    I suspect you added map.connect after other definitions, which would give it lowest priority. Try putting it in the beginning of routes.rb file.

    You can also use named routes to avoid confusion:

    map.manage_user '/users/:id/manage', :controller => :users, :action => :manage
    

    and then refer it as

    link_to 'Manage', manage_user_path(:id => user)
    

    edit
    If that doesn’t work, please show your routes.rb file.

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

Sidebar

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.