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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:08:33+00:00 2026-05-25T01:08:33+00:00

I would like to have a route like this get users/sms_confirmation/:sms_confirmation_code => users#sms_confirmation bind

  • 0

I would like to have a route like this

get "users/sms_confirmation/:sms_confirmation_code" => "users#sms_confirmation"

bind the :sms_confirmation_code param like the following example:

A request to users/sms_confirmation/ABC123 results in the params hash containing

{:user => {:sms_confirmation_code => "ABC123"}} # This is what I want

Currently the route gives me:

{:sms_confirmation_code => "ABC123"} # This is what I've got.

As of yet I cannot find a way to do this with Rails 3 routing. Is there a way to accomplish this?

Working around this problem is easy, but I don’t want to do it if it’s unnecessary.

UPDATE: sms_confirmation_code is a fields in the users table. My goal is to use pretty URLs such as the one in the example above rather than a query string appended to the URL. I also want to avoid extra code in the controller to structure a hash like described above.

  • 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-25T01:08:34+00:00Added an answer on May 25, 2026 at 1:08 am

    sms_confirmation is nested under users right?

    shouldn’t it be something likeusers/123/sms_confirmation/ABC123 ?

    resources :users do
      resources :sms_confirmation do
        get "users/:user_id/sms_confirmation/:sms_confirmation_code" => "users#sms_confirmation"
      end
    end
    

    if you don’t have a users controller you could use a namespace such as

    namespace "users" do
     resources :sms_confirmation do
      get "sms_confirmation" => "users#sms_confirmation"
     end     
    end
    

    Tell me if it worked!

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

Sidebar

Related Questions

I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page
In my routing I would like to have something like not found route handler.
I would like to have a nice template for doing this in development. How
I would like to have group based restrictions that would allow users to access
heres my setup: http://www.example.com/<module>/<controller>/<action> I have this route defined: $router->addRoute( 'editUser', new Zend_Controller_Router_Route('admin/users/edit/:id', array(
I have a problem that I would like have solved via a SQL query.
I would like to have a reference for the pros and cons of using
I would like to have an iframe take as much vertical space as it
I would like to have a VM to look at how applications appear and
We would like to have user defined formulas in our c++ program. e.g. The

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.