Sha256: 0eeb77b9884647197e31e776d5618208993e51f9b7e6753e005a2650e2b3524c

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

if Rails::VERSION::MAJOR >= 3

  Rails.application.routes.draw do
    scope :module => "rich" do
      %w(login logout update).each do |action|
        match "/cms/#{action}" => "cms##{action}", :as => "rich_cms_#{action}"
      end
      match "/cms/"         => "cms#display", :as => "rich_cms"     , :display => true
      match "/cms/hide"     => "cms#display", :as => "rich_cms_hide", :display => false
      match "/cms/position" => "cms#position"
    end
  end

else

  # TODO: add routes the right way as this is evil
  class << ActionController::Routing::Routes;self;end.class_eval do
    define_method :clear!, lambda {}
  end
  # END

  ActionController::Routing::Routes.draw do |map|
    map.namespace :rich, :path_prefix => "" do |rich|

      %w(login logout update).each do |action|
        rich.send "cms_#{action}", "cms/#{action}", :controller => "cms", :action => action
      end

      rich.cms      "cms"         , :controller => "cms", :action => "display", :display => true
      rich.cms_hide "cms/hide"    , :controller => "cms", :action => "display", :display => false
      rich.connect  "cms/position", :controller => "cms", :action => "position"

    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rich_cms-2.1.7 config/routes.rb
rich_cms-2.1.6 config/routes.rb
rich_cms-2.1.5 config/routes.rb
rich_cms-2.1.4 config/routes.rb
rich_cms-2.1.3 config/routes.rb
rich_cms-2.1.2 config/routes.rb
rich_cms-2.1.1 config/routes.rb
rich_cms-2.1.0 config/routes.rb