Added meta robots tag to the default layout; added error handling to published pages
This commit is contained in:
parent
9e7306fb0a
commit
d3b25c8a19
3 changed files with 18 additions and 8 deletions
|
@ -2,7 +2,7 @@
|
|||
# Likewise will all the methods added be available for all controllers.
|
||||
class ApplicationController < ActionController::Base
|
||||
|
||||
before_filter :connect_to_model, :setup_url_generator, :set_content_type_header
|
||||
before_filter :connect_to_model, :setup_url_generator, :set_content_type_header, :set_robots_metatag
|
||||
after_filter :remember_location, :teardown_url_generator
|
||||
|
||||
observer :page_observer
|
||||
|
@ -152,6 +152,14 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
def set_robots_metatag
|
||||
if controller_name == 'wiki' and %w(show published).include? action_name
|
||||
@robots_metatag_value = 'index,follow'
|
||||
else
|
||||
@robots_metatag_value = 'noindex,nofollow'
|
||||
end
|
||||
end
|
||||
|
||||
def setup_url_generator
|
||||
PageRenderer.setup_url_generator(UrlGenerator.new(self))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue