Permalink
Browse files

Refactored routes with only one path_prefix.

  • Loading branch information...
1 parent 99c1e6e commit 43462e6632b38f67216364f795c5a962a37e5a4d Francesc Esplugas committed Apr 6, 2009
Showing with 13 additions and 15 deletions.
  1. +13 −15 lib/typus/routes.rb
View
28 lib/typus/routes.rb
@@ -4,22 +4,20 @@ class << ActionController::Routing::Routes;self;end.class_eval do
ActionController::Routing::Routes.draw do |map|
- path_prefix = Typus::Configuration.options[:path_prefix]
-
- map.with_options :controller => 'typus', :path_prefix => path_prefix do |i|
- i.admin_quick_edit 'quick_edit', :action => 'quick_edit'
- i.admin_dashboard '', :action => 'dashboard'
- i.admin_sign_in 'sign_in', :action => 'sign_in'
- i.admin_sign_out 'sign_out', :action => 'sign_out'
- i.admin_sign_up 'sign_up', :action => 'sign_up'
- i.admin_recover_password 'recover_password', :action => 'recover_password'
- i.admin_reset_password 'reset_password', :action => 'reset_password'
- i.admin_set_locale 'set_locale', :action => 'set_locale'
- end
-
- map.namespace :admin do |admin|
+ map.with_options :path_prefix => Typus::Configuration.options[:path_prefix] do |typus|
+
+ typus.with_options :controller => 'typus' do |i|
+ i.admin_quick_edit 'quick_edit', :action => 'quick_edit'
+ i.admin_dashboard '', :action => 'dashboard'
+ i.admin_sign_in 'sign_in', :action => 'sign_in'
+ i.admin_sign_out 'sign_out', :action => 'sign_out'
+ i.admin_sign_up 'sign_up', :action => 'sign_up'
+ i.admin_recover_password 'recover_password', :action => 'recover_password'
+ i.admin_reset_password 'reset_password', :action => 'reset_password'
+ i.admin_set_locale 'set_locale', :action => 'set_locale'
+ end
- admin.with_options :path_prefix => path_prefix do |i|
+ typus.namespace :admin do |i|
Typus.resources.each do |resource|
i.connect "#{resource.underscore}/:action", :controller => resource.underscore

0 comments on commit 43462e6

Please sign in to comment.