map.connect '':controller/:action/:id'', :requirements => { :id => /^(.html)/ } The requirement is turning all of my routes into /foo?id=54354 instead of /foo/54354 Why? -- Posted via http://www.ruby-forum.com/.
Guest wrote:> map.connect '':controller/:action/:id'', :requirements => { :id => > /^(.html)/ } > > > The requirement is turning all of my routes into /foo?id=54354 instead > of /foo/54354 > > > Why?I can only ask that you ignore the regex dealing with .html because of the business requirements. -- Posted via http://www.ruby-forum.com/.
On Thu Jun 22, 2006 at 07:49:18AM +0200, Guest wrote:> map.connect '':controller/:action/:id'', :requirements => { :id => > /^(.html)/ } > > > The requirement is turning all of my routes into /foo?id=54354 instead > of /foo/54354ive noticed similar stuff. are you using SVN? i m prett sure some things subtly changed. but i need to do an SVN up and see if it goes awa, i havent updated for a few weeks. basically everything works fine on a production server with apache, but here, things are totally screwed, i get a lot of that ?id= crap..> > > Why? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
carmen
2006-Jun-22 06:13 UTC
[Rails] routing breakage, or the ''right way'' to do short_urls
routes are behaving much different (eg broken) for me lately (r4484). but maybe theres a better way to to short_urls anyways. this is my wild guess, which worked fine with 1.1.2, but is unfortunately not consoldated to routes.rb: _routes__ map.entity ''entity/:id'', :controller => ''entity'', :action => ''show'', :requirements => { :id=> /\d+/ } map.entity ''*shorturl'',:controller => ''entity'', :action => ''show'' _helper_ module EntityHelper def u(e) e.short_url ? entity_url(:shorturl => e.short_url) : entity_url(:id => e.id) end end _ctrlr_ @e = Entity.find(params[:id]) if params[:id] @e = Entity.find_by_short_url(params[:shorturl]) if params[:shorturl] in the meantime, ive gone back to the revision in use on the server...