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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:30:10+00:00 2026-05-27T05:30:10+00:00

I am new to ruby, i would like to pass parameters in the url

  • 0

I am new to ruby, i would like to pass parameters in the url and receive it in controller.

I am expecting operation like

www.mysite.com/getuser/id/22

where getuser is the param name and 22 is its value.

Please provide me if there is any useful links that i can refer to.

Thanks in advance

  • 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-27T05:30:11+00:00Added an answer on May 27, 2026 at 5:30 am

    Please read everything in the Rails Guide to Routing. There are two main cases there:

    • RESTful routes: only use GET, PUT, POST, DELETE. Rails maps that by using the method resources. resources :pages will lead to the following routes (and URLs) automatically:

          sites GET    /sites(.:format) {:action=>"index", :controller=>"sites"}
                POST   /sites(.:format) {:action=>"create", :controller=>"sites"}
       new_site GET    /sites/new(.:format) {:action=>"new", :controller=>"sites"}
      edit_site GET    /sites/:id/edit(.:format) {:action=>"edit", :controller=>"sites"}
           site GET    /sites/:id(.:format) {:action=>"show", :controller=>"sites"}
                PUT    /sites/:id(.:format) {:action=>"update", :controller=>"sites"}
                DELETE /sites/:id(.:format) {:action=>"destroy", :controller=>"sites"}
      
    • Other routes: There is a rich set of methods you can use in your routes file to add additional routes. But keep in mind: If you just want to address a resource, it is better to stick to restful routes. A typical example is_ match ':controller(/:action(/:id))'. This allows URLs like:

      • localhost:3000/sites/help: controller == SitesController, action == help
      • localhost:3000/sites/search/something: controller == SitesController, action == search, parameter in params is something under the key id. So inside the action search, you will find params[:id] bound to "something".
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new at ruby and I would like to ask you guys if there's
I'm new to Ruby on Rails and would like to know that, if there
I am quite new in Ruby so would like to know and learn how
I am new to Ruby on Rails (3). I would like to study some
I would like to dynamically specify the parent class for a class in Ruby.
In ruby it would look like myfunction ([element1, element2, element3],other argument) Can I do
I am using Ruby on Rails 3.0.7 and I would like to install and
I am using Ruby on Rails 3.0.7 and I would like to use check
I am using Ruby on Rails 3.0.9 and I would like to show a
I am building web applications using Ruby on Rails and I would like to

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.