Redirect a url with only some get params in Rails 4

73 views Asked by At

I am developing an application that should still respond to some old urls from a previous web application. I would like to build some redirects to an action only when a param(get param) is present. for instance

get '/students/:id?school_id=(:id)', to: redirect { |params, req|
     # path of the a known action here
}

How will it recognize urls like this:

/students/:id?school_id=25957,

but NOT urls like this:

/students/:id?address=345

0

There are 0 answers