lundi 18 avril 2016

How to make url_for return slashed parameters rather than (? & based parameters)

Rails 2.3.5:

Routes:

map.connect ':controller/:action/:sort_key/:sort_order'

options:

{"controller"=>"sections", "action"=>"list", "params"=>{"sort_key"=>"sect_code", "sort_order"=>"asc"}}

url_for(options) will give me:

/sections/list/sect_code/asc

In Rail 4.2,

Routes:

  get ':controller/:action/:sort_key/:sort_order'

url_for(options) (same options) will give me,

/sections/list?sort_key=sect_code&sort_order=asc

Is this difference intended? Is it possible to make the behaviour same?

Thanks.

Aucun commentaire:

Enregistrer un commentaire