diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-02-10 16:16:43 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-02-16 12:59:27 +0000 |
commit | 2d295bb7edf9d7170c6cfb0418820292a637e9b6 (patch) | |
tree | b47222023dc16eacd776a430f241cbdcf96884ad | |
parent | 92fea9c55d70701f801cc860553ee4a8d451efce (diff) |
Tweak the custom routes mechanism
It didn’t seem to work before. (?)
Note that this requires a change to the code as e.g. in
https://github.com/sebbacon/alavetelitheme/blob/master/lib/config/custom-routes.rb
because the route configuration code should not be inside a
Dispatcher.to_prepare block now.
-rw-r--r-- | config/routes.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/config/routes.rb b/config/routes.rb index fa387a106..747cc9b06 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,6 +6,9 @@ # # $Id: routes.rb,v 1.92 2009-10-14 22:01:27 francis Exp $ +# Allow easy extension from themes. Note these will have the highest priority. +load File.join('config', 'custom-routes.rb') + ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created -> highest priority. @@ -14,9 +17,6 @@ ActionController::Routing::Routes.draw do |map| # map.connect 'products/:id', :controller => 'catalog', :action => 'view' # Keep in mind you can assign values other than :controller and :action - # Allow easy extension from themes. Note these will have the highest priority. - require File.join('config', 'custom-routes') - map.with_options :controller => 'general' do |general| general.frontpage '/', :action => 'frontpage' general.blog '/blog', :action => 'blog' |