Class Cms::RoutesController
In: app/controllers/cms/routes_controller.rb
Parent: Cms::BaseController

Methods

index  

Public Instance methods

[Source]

    # File app/controllers/cms/routes_controller.rb, line 4
 4:   def index
 5:   
 6:     @toolbar_tab = :administration
 7:     
 8:     unless params[:path].blank?
 9:       @path = params[:path]
10:       @route = ActionController::Routing::Routes.recognize_path(@path)
11:     end
12:     
13:     @routes = ActionController::Routing::Routes.routes.collect do |route|
14:       name = ActionController::Routing::Routes.named_routes.routes.index(route).to_s
15:       verb = route.conditions[:method].to_s.upcase
16:       segs = route.segments.inject("") { |str,s| str << s.to_s }
17:       segs.chop! if segs.length > 1
18:       reqs = route.requirements.empty? ? "" : route.requirements.inspect
19:       {:name => name, :verb => verb, :segs => segs, :reqs => reqs}
20:     end
21:     
22:   end

[Validate]