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