Sha256: 3f221790e30e64d8e2389cd04a219b1e1949f143832b8f6514fd0a86a23b36d9

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 KB

Contents

Portfolio::Engine.routes.draw do
  if Portfolio.auth_method == :portfolio_admin_user
    devise_for :admin_users, class_name: 'Portfolio::AdminUser', module: :devise
  end

  namespace :admin do
    post 'markdown_preview' => 'api#markdown_preview'

    resources :site_item_categories
    resources :site_item_tags
    resources :social_links
    resources :sites do
      resources :site_social_links
      resources :site_menu_links
      Portfolio::SiteItem::subclasses.each do |klass|
        resources klass.resource_name.pluralize do
          resources :site_item_images do
            member { put :set_default }
          end
        end
      end
    end

    root 'sites#index'
  end

  Portfolio::SiteItem.subclasses.each do |klass|
    resource_name = klass.human_name
    resource_plural_name = resource_name.pluralize
    resource_display_name = (klass.display_name || resource_plural_name).downcase

    get "/:portfolio_key/#{resource_display_name}/:title-:id" =>
        "site_#{resource_plural_name}#show",
        as: "show_portfolio_#{resource_name}"

    get "/:portfolio_key/#{resource_display_name}" =>
        "site_#{resource_plural_name}#index",
        as: "portfolio_#{resource_plural_name}"

    get "/:portfolio_key/#{resource_display_name}/tagged/:tag_key" =>
        "site_#{resource_plural_name}#index",
        as: "portfolio_#{resource_plural_name}_tagged"
  end

  get '/:portfolio_key' => 'sites#show_by_key', as: :show_portfolio
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails-portfolio-0.0.5 config/routes.rb
rails-portfolio-0.0.4 config/routes.rb
rails-portfolio-0.0.3 config/routes.rb
rails-portfolio-0.0.2 config/routes.rb
rails-portfolio-0.0.1 config/routes.rb