3 ms·
Without the gem, making your RESTful routes have the right plural/singular forms takes something like this: match 'jobs' => 'jobs#index', :via => :get, :as
by timriley 15y ago
Without the gem, making your RESTful routes have the right plural/singular forms takes something like this:
match 'jobs' => 'jobs#index', :via => :get, :as => :jobs
match 'jobs' => 'jobs#create', :via => :post
resources :job, :controller => 'jobs', :except => [:index, :create]
For a bunch of resources, it's certainly much easier to use the one-line `tasteful_resources` helper instead.
It's your call as to whether you think this is worthwhile, but we think that these small details matter, even in URLs.
- alttab 15y agoI don't understand why changing the way rails does its routing provides any benefit to the application or its code base. Any rails helpers that depend on default resource routes will break or require special decorators to maintain consistency. Experience rails developers entering your code base will be confused why their newest partial didn't just work, and will have to learn in one form or another the customization this gem provides. So now you maintain an entire "system" on top of rails for the benefit of reversing the pluralization of models, something a well placed monkey patch could do with less lines and overall maintenance. All of this of course is limited to my opinion, your miles may vary. Generally, I've learned from those more experienced that quick and dirty will get you farther, faster, than building things you will never use.