I'm looking for some confirmation before I go further astray.
I decided to anticipate future growth and rather than use a flat
controller directory (app/controllers ) without subfolders , I would
try a 'tree' structure with subfolders (app/controllers/admin, app/
controllers/info, etc.).
Duh, but I ended up with broken routes. The fix seems to be to add
all the necessary permutations of subdirectory routes to the routes.rb
file. This of course leads to a fate potentially worse than the basic
flat directory.
Am I missing something easier and more generic to accommodate the
routing for 'tree' directories.?
Thanks to Nicholas Henry and Sijo Kg for responding.
Having to add the routes to the routes.rb file still seems a
cumbersome approach, but so be it. Unfortunately it isn't working as
I raise a Routing Error ( No route matches "/link" with
{:method=>:get} ) with the following configuration
Your much appreciated replies have given me some insight and got me
moving again. The RESTful reading recommendation (RailsGuide) is
excellent and has shed considerable light on what was a murky subject
for me.
However, one further question regarding the link_to helper.
Since Rails conserves paths (and breaks routes when mapping
namespaces), I amended the old style link_to method by adding a
forward slash in front of the controller name ('home' to '/home').