Module: Gluttonberg::Content::DefaultTemplateFile
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/gluttonberg/content/default_template_file.rb
Overview
This mixin provides functionality for generating default template for any page description which needs template file.
Instance Method Summary collapse
-
#create_default_template_file ⇒ Object
if page type is not redirection or rewrite.
Instance Method Details
#create_default_template_file ⇒ Object
if page type is not redirection or rewrite. then create default view files for all localzations of the page. file will be created in host appliation/app/views/pages/template_name.locale-slug.html.haml
10 11 12 13 14 15 16 17 18 |
# File 'lib/gluttonberg/content/default_template_file.rb', line 10 def create_default_template_file unless self.description.redirection_required? || self.description.rewrite_required? pages_root = File.join(Rails.root, "app", "views" , "pages") FileUtils.mkdir(pages_root) unless File.exists?(pages_root) self.localizations.each do |page_localization| create_default_template_file_for_localization(page_localization, pages_root) end end end |