Sha256: 0cb87a8ffc8171d139e7a2d15d157395a2523f0b4ce502a18a199b0c5d1b21ac

Contents?: true

Size: 917 Bytes

Versions: 13

Compression:

Stored size: 917 Bytes

Contents

module Ecm
  module Pictures
    class Routing
      # Creates the routes for pictures and galleries. You can pass options to
      # specify the actions for both pictures and/or galleries.
      #
      #   Ecm::Pictures::Routing.routes(self, { :picture_gallery_actions => [ :show ]})
      #
      # This will only create the show action for picture galleries, but omit the index action.
      def self.routes(router, options = {})
        options.reverse_merge!(
          { :picture_gallery_actions => [:index, :show], 
            :picture_actions => [:index, :show] 
          }
        )
        
        router.resources :ecm_pictures_picture_galleries, :only => options[:picture_gallery_actions], :controller => 'ecm/pictures/picture_galleries'
        router.resources :ecm_pictures_pictures,:only => options[:picture_actions], :controller => 'ecm/pictures/pictures'      
      end  
    end
  end
end    

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
ecm_pictures2-1.1.2 lib/ecm/pictures/routing.rb
ecm_pictures2-1.1.1 lib/ecm/pictures/routing.rb
ecm_pictures2-1.1.0 lib/ecm/pictures/routing.rb
ecm_pictures2-1.0.4 lib/ecm/pictures/routing.rb
ecm_pictures2-1.0.3 lib/ecm/pictures/routing.rb
ecm_pictures2-1.0.2 lib/ecm/pictures/routing.rb
ecm_pictures-2.1.0.pre lib/ecm/pictures/routing.rb
ecm_pictures-1.0.6.pre lib/ecm/pictures/routing.rb
ecm_pictures-1.0.5.pre lib/ecm/pictures/routing.rb
ecm_pictures-1.0.4.pre lib/ecm/pictures/routing.rb
ecm_pictures-1.0.3.pre lib/ecm/pictures/routing.rb
ecm_pictures-1.0.2.pre lib/ecm/pictures/routing.rb
ecm_pictures-1.0.1.pre lib/ecm/pictures/routing.rb