Sha256: 6e50e59b3ec233322ac1f8e83ef915a0f79f066f799a8881747622ac7d7369dc

Contents?: true

Size: 483 Bytes

Versions: 20

Compression:

Stored size: 483 Bytes

Contents

require_dependency "pages_cms/application_controller"

module PagesCms
  class ArticlesController < ApplicationController

    def index
      @articles = Article.published
      filter_params(params).each do |search, result|
        @articles = @articles.public_send(search, result) if result.present?
      end
    end

    def show
      @article = Article.find(params[:id])
    end

    private
      def filter_params(params)
        params.slice(:search)
      end


  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pages_cms-2.4.2 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.3.2 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.3.1 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.3.0 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.2.3 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.2.2 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.2.1 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.1.1 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.1.0 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.0.1 app/controllers/pages_cms/articles_controller.rb
pages_cms-2.0.0 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.2.3 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.2.2 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.2.1 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.2.0 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.1.0 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.0.8 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.0.6 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.0.5 app/controllers/pages_cms/articles_controller.rb
pages_cms-1.0.4 app/controllers/pages_cms/articles_controller.rb