Sha256: 1f5fb7af689ee56948b69e662591f7c6fe5ddc3805efce551bc63619d47358cd

Contents?: true

Size: 943 Bytes

Versions: 8

Compression:

Stored size: 943 Bytes

Contents

module Ecm
  module Downloads
    class Routing
      # Creates the routes for downloads and categories. You can pass options to
      # specify the actions for both downloads and/or categories.
      #
      #   Ecm::Downloads::Routing.routes(self, { :download_category_actions => [ :show ]})
      #
      # This will only create the show action for download categories, but omit the index action.
      def self.routes(router, options = {})
        options.reverse_merge!(
          { :download_category_actions => [:index, :show], 
            :download_actions => [:index, :show] 
          }
        )
        
        router.resources :ecm_downloads_download_categories, :only => options[:download_category_actions], :controller => 'ecm/downloads/download_categories'
        router.resources :ecm_downloads_downloads,:only => options[:download_actions], :controller => 'ecm/downloads/downloads'      
      end  
    end
  end
end    

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ecm_downloads-0.0.10.pre lib/ecm/downloads/routing.rb
ecm_downloads-0.0.8.pre lib/ecm/downloads/routing.rb
ecm_downloads-0.0.7.pre lib/ecm/downloads/routing.rb
ecm_downloads-0.0.6.pre lib/ecm/downloads/routing.rb
ecm_downloads-0.0.5.pre lib/ecm/downloads/routing.rb
ecm_downloads-0.0.4 lib/ecm/downloads/routing.rb
ecm_downloads-0.0.3 lib/ecm/downloads/routing.rb
ecm_downloads-0.0.2 lib/ecm/downloads/routing.rb