Class: Publinator::SectionController
Instance Method Summary
collapse
#body_id, #current_controller, #current_domain, #current_layout, #current_site, #current_site_name
Instance Method Details
#index ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/publinator/section_controller.rb', line 7
def index
@publication = Publinator::Publication.find_by_section_id_and_slug(@section.id, 'index')
@publishable = @publication.publishable
if @publication.publishable_type
@publishable_type = Publinator::PublishableType.find_by_name(@publication.publishable_type.classify)
end
begin
render "#{params[:section]}/index"
rescue ActionView::MissingTemplate
render "publinator/publishable/show"
end
end
|
#show ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'app/controllers/publinator/section_controller.rb', line 20
def show
@publication = Publinator::Publication.find(:first, :conditions => ["section_id = ? and slug = ?", @section.id, params[:id]])
@publishable = @publication.publishable
if @publication.publishable_type
@publishable_type = Publinator::PublishableType.find_by_name(@publication.publishable_type.classify)
end
begin
if @publishable_type
render "#{@publishable_type.tableize}/show"
else
render "#{params[:section]}/#{@publication.slug}"
end
rescue ActionView::MissingTemplate
render "publinator/publishable/show"
end
end
|