Class: RailsPage

Inherits:
Page
  • Object
show all
Defined in:
app/models/rails_page.rb

Instance Attribute Summary collapse

Attributes inherited from Page

#pagination_parameters, #request, #response

Instance Method Summary collapse

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, find_by_path, find_by_url, #has_or_inherits_part?, #has_part?, #headers, #inherits_part?, is_descendant_class_name?, #layout_with_inheritance, load_subclasses, missing?, new_with_defaults, #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

included

Methods included from TrustyCms::Taggable

included, #render_tag, #tag_descriptions, #tags, #warn_of_tag_deprecation

Methods included from LocalTime

#adjust_time

Instance Attribute Details

Returns the value of attribute breadcrumbs.



3
4
5
# File 'app/models/rails_page.rb', line 3

def breadcrumbs
  @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_url(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_url(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

#urlObject



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