Sha256: 83eb3d03dd4dc066012df74a0f71967000c551bc92fc27f3d76ae731a59f008f

Contents?: true

Size: 573 Bytes

Versions: 21

Compression:

Stored size: 573 Bytes

Contents

class CMS::Routes < SimpleDelegator
  def draw
    namespace :cms do
      get 'description' => 'root#description'
      get '' => 'root#index'

      CMS::Configuration.types.each do |type|
        resources type.model_name.route_key
      end

      yield if block_given?
    end

    CMS::Configuration.pages.each do |page|
      if page.editable?
        get page.route => 'cms/pages#show', page: page.action, as: "cms_#{page.action}"
      else
        get page.route => 'cms/pages#static_page', page: page.action, as: "cms_#{page.action}"
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
honey-cms-0.5.1 lib/cms/routes.rb
honey-cms-0.4.8 lib/cms/routes.rb
honey-cms-0.4.7 lib/cms/routes.rb
honey-cms-0.4.6 lib/cms/routes.rb
honey-cms-0.4.5 lib/cms/routes.rb
honey-cms-0.4.2 lib/cms/routes.rb
honey-cms-0.4.1 lib/cms/routes.rb
honey-cms-0.4.0 lib/cms/routes.rb
honey-cms-0.3.13 lib/cms/routes.rb
honey-cms-0.3.12 lib/cms/routes.rb
honey-cms-0.3.11 lib/cms/routes.rb
honey-cms-0.3.10 lib/cms/routes.rb
honey-cms-0.3.9 lib/cms/routes.rb
honey-cms-0.3.8 lib/cms/routes.rb
honey-cms-0.3.7 lib/cms/routes.rb
honey-cms-0.3.5 lib/cms/routes.rb
honey-cms-0.3.4 lib/cms/routes.rb
honey-cms-0.3.3 lib/cms/routes.rb
honey-cms-0.3.2 lib/cms/routes.rb
honey-cms-0.3.1 lib/cms/routes.rb