Class: RailsPage
- Defined in:
- app/models/rails_page.rb
Instance Attribute Summary collapse
-
#breadcrumbs ⇒ Object
Returns the value of attribute breadcrumbs.
Attributes inherited from Page
#pagination_parameters, #request, #response
Instance Method Summary collapse
- #build_parts_from_hash!(content) ⇒ Object
- #find_by_path(url, live = true, clean = true) ⇒ Object
- #url ⇒ Object
- #url=(path) ⇒ Object
Methods inherited from Page
#allowed_children_lookup, #cache?, #child_path, date_column_names, #default_child, descendant_class, #description, #description=, display_name, display_name=, #field, find_by_path, #has_or_inherits_part?, #headers, #inherits_part?, is_descendant_class_name?, #layout_with_inheritance, load_subclasses, missing?, new_with_defaults, #part, #part?, #path, #process, #published?, #render, #render_part, #render_snippet, #response_code, root, save_order, #scheduled?, #set_allowed_children_cache, #status, #status=, #update_status
Methods included from Annotatable
Methods included from TrustyCms::Taggable
included, #render_tag, #tag_descriptions, #tags, #warn_of_tag_deprecation
Instance Attribute Details
#breadcrumbs ⇒ Object
Returns the value of attribute breadcrumbs.
3 4 5 |
# File 'app/models/rails_page.rb', line 3 def @breadcrumbs end |
Instance Method Details
#build_parts_from_hash!(content) ⇒ Object
23 24 25 26 27 |
# File 'app/models/rails_page.rb', line 23 def build_parts_from_hash!(content) content.each do |k, v| (part(k) || parts.build(name: k.to_s, filter_id: '')).content = v end end |
#find_by_path(url, live = true, clean = true) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/models/rails_page.rb', line 5 def find_by_path(url, live = true, clean = true) found_page = super if found_page.nil? || found_page.is_a?(FileNotFoundPage) url = clean_url(url) if clean self if url.starts_with?(self.url) else found_page end end |
#url ⇒ Object
19 20 21 |
# File 'app/models/rails_page.rb', line 19 def url @url || super end |
#url=(path) ⇒ Object
15 16 17 |
# File 'app/models/rails_page.rb', line 15 def url=(path) @url = path end |