Sha256: 1c3c194ee08a146de66540a240e4d075316f30a10d4505ad4995756edd372b58

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

module Kinney
  class TopicsController < KinneyController
    
    caches_action :index, :show
    
    def index
      @topics = Topic.with_clips
    end
    
    def show
      @topic = Topic.find(params[:id])
      @title = @topic.name
      @meta_description = @topic.description
      # If an old id or a numeric id was used to find the record, then
      # the request path will not match the topic_path, and we should do
      # a 301 redirect that uses the current friendly id.
      if !@topic.slug.blank? and params[:id] != @topic.slug
        return redirect_to @topic, :status => :moved_permanently
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kinney-0.0.3 app/controllers/kinney/topics_controller.rb
kinney-0.0.2 app/controllers/kinney/topics_controller.rb
kinney-0.0.1 app/controllers/kinney/topics_controller.rb