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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:24:13+00:00 2026-05-25T20:24:13+00:00

I am porting a zend framework / php app to rails and there is

  • 0

I am porting a zend framework / php app to rails and there is a set of parameters for something like a query.

For example:

/locations/get-all-locations/lat/xxx.xxx/lng/xxx.xxx/radius/5/query/lemonade/updated_prev_hours/72

but could provide variations of this like leaving out the query or distance paramenters (ie basically some could be required in different sets – another question). It would seem like all parameters would need to be named.

Would this be best handled by a static segement like this:

match 'locations/get-all-locations/lat/:lat/lng/:lng/radius/:radius/query/:query/updated_prev_hours/:updated_prev_hours => 'locations#get_all_locations'

Is that all I need and the values will be available in the params hash? Or is there a better strategy for handling complex urls like this?

thx

  • 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-25T20:24:14+00:00Added an answer on May 25, 2026 at 8:24 pm

    This looks like you are going too deep in the URL and simply using the query string would be more appropriate. However if you are porting and have not other option then you can do this with route globbing.

    Something like:

    match "locations/get-all-locations/*options" => "locations#get_all_locations"
    

    You can then match these up by doing:

    Hash[*params[:options].split("/")]
    

    Or merge them by doing:

    params.merge!(Hash[*params[:options].split("/")])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im porting a project from php to java. The project is a web-app based
I'm working on a porting of a simple project to a zend framework project
Porting an application from C# (1.1 framework) to VB.NET (3.5 framework), and I have
I am planning on porting a PHP application over to Python. The application is
I've been trying a bunch of different directory structures for my PHP MVC framework.
I have some questions: Does Zend AMF has a service browser feature like AMFPHP
Porting my bat scripts to PowerShell. Two problems: $info expands in strings like $info
I'm looking at porting a custom-written PHP CMS into Django. One of the features
I am porting an app that I originally wrote using the accelerometer for IOS
I am using Zend Framework 1.9.6. I want to start using cron jobs. I

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.