public
Description: Rails plugin to quickly make named routes for non-RESTful actions.
Clone URL: git://github.com/ryanb/static_actions.git
adding documentation for root methods
Ryan Bates (author)
Thu Apr 03 11:58:15 -0700 2008
commit  04f723450d115c8e42db18b8a493e0556b18e3da
tree    c128011fd708003b212dc874c64b45f09e218063
parent  061cdf2c98a6ba6fb0c537e11f29268741135bff
0
...
44
45
46
 
 
 
 
 
 
 
 
 
 
 
 
 
47
48
49
...
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
0
@@ -44,6 +44,19 @@ If you just have a single action, you can use the singular static_action method
0
   
0
   map.static_action :about, :privacy
0
 
0
+
0
+If you don't want the controller name to be in the named route or path, you can prefix the method with "root_".
0
+
0
+ map.root_static_actions :about, [:index, :privacy, :license]
0
+
0
+This will generate the following routes.
0
+
0
+ map.root :controller => 'about'
0
+ map.privacy 'privacy', :controller => 'about', :action => 'privacy'
0
+ map.license 'license', :controller => 'about', :action => 'license'
0
+ map.privacy_with_format 'privacy.:format', :controller => 'about', :action => 'privacy'
0
+ map.license_with_format 'license.:format', :controller => 'about', :action => 'license'
0
+
0
 Happy routing.
0
 
0
 ---

Comments

    No one has commented yet.