Class: TagsController
Instance Method Summary
collapse
Methods included from BlogHelper
#blog_base_url, #this_blog
Instance Method Details
#index ⇒ Object
7
8
9
10
11
12
|
# File 'app/controllers/tags_controller.rb', line 7
def index
@tags = Tag.page(params[:page]).per(100)
@page_title = controller_name.capitalize
@keywords = ""
@description = "Tags for #{this_blog.blog_name}"
end
|
#show ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'app/controllers/tags_controller.rb', line 14
def show
@tag = Tag.find_by!(name: params[:id])
@articles = @tag
.contents.includes(:blog, :user, :tags, :resources)
.published.page(params[:page]).per(10)
respond_to do |format|
format.html do
if @articles.empty?
raise ActiveRecord::RecordNotFound
else
@page_title = this_blog.tag_title_template.to_title(@tag, this_blog, params).strip
@description = this_blog.tag_desc_template.to_title(@tag, this_blog, params).strip
@keywords = this_blog.meta_keywords
render template_name(params[:id])
end
end
format.atom do
@articles = @articles[0, this_blog.]
render_cached_xml "articles/index_atom_feed", @articles
end
format. do
@articles = @articles[0, this_blog.]
render_cached_xml "articles/index_rss_feed", @articles
end
end
end
|