Class: PageLink
Instance Method Summary
collapse
Methods inherited from MenuLink
#clone, #kind, #kind=, #url_and_children_urls, #url_and_parent_urls, #url_match?, #url_with_target
Instance Method Details
#page_and_children_pages ⇒ Object
12
13
14
15
16
|
# File 'app/models/page_link.rb', line 12
def page_and_children_pages
[self.target] +
self.children.all(:conditions => {:type => 'PageLink'}).
map(&:page_and_children_pages)
end
|
#url ⇒ Object
2
3
4
5
6
7
8
9
10
|
# File 'app/models/page_link.rb', line 2
def url
page = Page.find_by_id(self.target_id)
if page
"/#{page.url}"
else
"#"
end
end
|