wbr wrote: > I have a search form that generates ugly but functional urls.The > controller takes nested parameters from the url like program > [program_id], or program[leader][leader_id]. > > So I'm trying to create a named route to make certain pre-defined > searches easier for customers to embed in their own pages. > > So instead of > > "https://ourdomain.com/search?program[leader_id]=12345" > > Id like to have > > "https://ourdomain.com/leader/12345" > > The problem is that a named Rails route won't accept a complex symbol > in the path definition: > > map.leader 'leader/:program[leader_id]' > > fails due to the brackets in parameter name symbol. Even properly > defining the symbol as > > map.leader "leader/:'program[leader_id]'" > > fails. Rails just won't recognize anything other than a downcase > single word.
So in the controller, just do params[:program][:leader_id] = params[:leader_id] . Or introduce a LeadersController. > > ... and I'm not in a position to change how the controller works or > redefine the expected incoming parameters. Why aren't you? If you're going to develop the app, you need to be able to make the necessary changes. > > > > Thoughts or suggestions or workarounds? > > Thanks, > Bill Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

