Sha256: c5e1b938f6585bcaae08d98db051d092965467f5cdac6545e2d837f34d2bde22

Contents?: true

Size: 451 Bytes

Versions: 1

Compression:

Stored size: 451 Bytes

Contents

class Monologue::TagsController < Monologue::ApplicationController
  caches_page :show , if: Proc.new { monologue_page_cache_enabled? }
  def show
    @tag = retrieve_tag
    if @tag
      @page = nil
      @posts = @tag.posts_with_tag
    else
      redirect_to :root ,notice: "No post found with label \"#{params[:tag]}\""
    end
  end

  private
  def retrieve_tag
    Monologue::Tag.where("lower(name) = ?", params[:tag].downcase).first
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
monologue-0.3.0 app/controllers/monologue/tags_controller.rb