Module: Kinney::Concerns::Controllers::ClipTopicsController

Extended by:
ActiveSupport::Concern
Included in:
TopicsController
Defined in:
lib/concerns/controllers/topics_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
# File 'lib/concerns/controllers/topics_controller.rb', line 4

def index
  @topics = Kinney::Topic.with_clips
end

#showObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/concerns/controllers/topics_controller.rb', line 8

def show
  @topic = Kinney::Topic.friendly.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