4 ms·
Rails 3.0.5 broke my routes and kicked my dog
- jrockway 16y agoDoes Rails not have a release candidate process? If not, that's odd. If so, you should test the release candidates, that's what they're for!
- catch23 16y agoI've been using namespaces with path methods like namespace_resource_path in 3.0.1 without issues... I think they just made the rules for calling a route more strict since without the namespace prepended on the path method could lead to confusion.
- YuriNiyazov 16y agoHi Matt I agree that they screwed up re: backwards compatibility (in fact, michael koz said as much in the comments), so that's inexcusable. However, the new change makes the URL name functions more consistent, because the new behavior for custom actions was always true for default actions Before: comment_like GET ... products_comments GET ... After: products_comment_like GET ... products_comments GET ...
- ryanbigg 16y agoRails 3.0.5 did nothing wrong. The correct code for this: namespace :products do resources :comments do member do get :like end end end Using a `get` without a `member` block leads to the misbehaviour as seen here, and it's also non-standard. When defining additional actions for a resource one should always use a `member` block for actions that work on a single object or `collection` for those actions that work on many.
- mceachen 16y agoThanks for sharing about member blocks. I'll update our routes to use them.
- JonnieCache 16y agoWith a single member route it's more concisely written like this: namespace :products do resources :comments do get :like, :on => :member end end
- deleted 16y ago[deleted]
- waratuman 16y agoUm... fix it and keep moving. Is this really worth a blog post?
- albemuth 16y agoMaybe there's a chance that someone on the internet will have the same problem?