Sha256: 4d931ad5282392935bc145570342fbf4f644bfbed4b306376edabfd9d4bcc9f2

Contents?: true

Size: 675 Bytes

Versions: 9

Compression:

Stored size: 675 Bytes

Contents

module Exposition
  module Concerns
    module Controller
      module TagsController
        extend ActiveSupport::Concern

        def show
          @tag = Categorical::Tag.find_by_slug!(params[:id])
          @taggables = @tag.
            send(fetch_taggable_type).
            published.
            sorted_by_published_date.
            page(params[:page]).
            per(10)
        end

        private

        def fetch_taggable_type
          if params[:type]
            taggable_type = params[:type]
            return taggable_type.underscore.to_sym
          else
            return "Exposition::Post"
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
exposition-0.0.5.7.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.5.6.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.5.5.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.5.4.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.5.2.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.5.1.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.5.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.4.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb
exposition-0.0.3.pre.alpha lib/exposition/concerns/controllers/tags_controller.rb