An experiment to see what it would look like if Rails controllers specified how to reach themselves, rather than having an omniscient routes.rb file.
Ruby JavaScript CoffeeScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
test
vendor
.gitignore
Gemfile
Gemfile.lock
README.rdoc
Rakefile
config.ru

README.rdoc

Route is an experiment to see what it would look like if Rails controllers specified how to reach themselves, rather than having an omniscient routes.rb file.

It contains a simple Rails project which illustrates a proof of concept in github.com/codeodor/route/blob/master/app/controllers/courses_controller.rb.

The code behind the proof of concept is in a gem which you'll find here: github.com/codeodor/route/tree/master/vendor/gems/route

It hooks into Rails with the railtie: github.com/codeodor/route/blob/master/vendor/gems/route/lib/route/railtie.rb and it does the work of sending the calls to specify routes in github.com/codeodor/route/blob/master/vendor/gems/route/lib/route/route.rb

See my blog post for discussion of why having Rails controllers specify their own routes could be a good (or bad) idea.