Sha256: 27415bb515843f226d9db196608629143d65e4d3b5b75b80bea8f209bb06f535

Contents?: true

Size: 744 Bytes

Versions: 18

Compression:

Stored size: 744 Bytes

Contents

module Ecm
  module News
    class Routing
      # Creates the routes for news items. You can pass options to
      # specify the actions for news items.
      #
      #   Ecm::News::Routing.routes(self, { :item_actions => [ :show ]})
      #
      # This will only create the show action for items, but omit the index
      # action.
      def self.routes(router, options = {})
        options.reverse_merge!(
          { :item_actions => [:index, :show]
          }
        )

        router.resources :ecm_news_items, :only => options[:item_actions],
                                          :controller => 'ecm/news/items' do
          router.get 'page/:page', :action => :index, :on => :collection
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
ecm_news2-1.2.0 lib/ecm/news/routing.rb
ecm_news2-1.1.1 lib/ecm/news/routing.rb
ecm_news2-1.1.0 lib/ecm/news/routing.rb
ecm_news2-1.0.4 lib/ecm/news/routing.rb
ecm_news2-1.0.3 lib/ecm/news/routing.rb
ecm_news2-1.0.2 lib/ecm/news/routing.rb
ecm_news2-1.0.0 lib/ecm/news/routing.rb
ecm_news-0.1.12.pre lib/ecm/news/routing.rb
ecm_news-0.1.10.pre lib/ecm/news/routing.rb
ecm_news-0.1.9.pre lib/ecm/news/routing.rb
ecm_news-0.1.8.pre lib/ecm/news/routing.rb
ecm_news-0.1.7.pre lib/ecm/news/routing.rb
ecm_news-0.1.5.pre lib/ecm/news/routing.rb
ecm_news-0.1.4.pre lib/ecm/news/routing.rb
ecm_news-0.1.3.pre lib/ecm/news/routing.rb
ecm_news-0.1.2.pre lib/ecm/news/routing.rb
ecm_news-0.1.1.pre lib/ecm/news/routing.rb
ecm_news-0.1.0.pre lib/ecm/news/routing.rb