Class: RailsPage

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

Returns the value of attribute breadcrumbs.



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

def breadcrumbs
  @breadcrumbs
end

Instance Method Details

#build_parts_from_hash!(content) ⇒ Object



24
25
26
27
28
# File 'app/models/rails_page.rb', line 24

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



6
7
8
9
10
11
12
13
14
# File 'app/models/rails_page.rb', line 6

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



20
21
22
# File 'app/models/rails_page.rb', line 20

def url
  @url || super
end

#url=(path) ⇒ Object



16
17
18
# File 'app/models/rails_page.rb', line 16

def url=(path)
  @url = path
end