Class: Monologue::ApplicationController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Monologue::ApplicationController
show all
- Defined in:
- app/controllers/monologue/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
11
12
13
14
15
16
|
# File 'app/controllers/monologue/application_controller.rb', line 11
def all_tags
@tags = Monologue::Tag.all(order: "name").select{|t| t.frequency>0}
@tags_frequency_min = @tags.map{|t| t.frequency}.min
@tags_frequency_max = @tags.map{|t| t.frequency}.max
end
|
#not_found ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/monologue/application_controller.rb', line 18
def not_found
file = Rails.root.join('public', '404.html')
if file.exist?
render file: file.cleanpath.to_s.gsub(%r{#{file.extname}$}, ''),
layout: false, status: 404, formats: [:html]
else
render action: "404", status: 404, formats: [:html]
end
end
|
#recent_posts ⇒ Object
7
8
9
|
# File 'app/controllers/monologue/application_controller.rb', line 7
def recent_posts
@recent_posts = Monologue::Post.published.limit(3)
end
|