I have a model, Image, with paperclip attachments. The necessary routes are currently simply defined by resources :images As each image is available in different sizes (styles, really), paths effectively look like this /images/1.png?size=thumb Which isn''t pretty at all. I''d rather have /images/1.png (for the default size) /images/1/thumb.png To get this, I''ve defined my routes like this resources :images get ''images/:id(/:size)(.:format)'' => ''images#show'', :as => :image The second line overwrites the image_path and image_url helpers generated by the first line. Is there another solution that doesn''t involve overwriting and makes resources generate the size routes? One important constraint is that I need the :size option on #image_path; it would not help to have additional routes with different names. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey, have you tried match? I''m using it and still can use _path and _url without a problem. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sunday 12 September 2010, Heinz Strunk wrote:> Hey, > > have you tried match? I''m using it and still can use _path and _url > without a problem.I''m sorry if I gave the wrong impression, I can still use all the _path and _url helpers. It''s just that I''m looking for a more elegant solution. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.