Class: Page
Constant Summary
StringLengthLimit::STRING_LIMIT
Instance Attribute Summary
Attributes included from ContentBase
#just_changed_published_status
Class Method Summary
collapse
Instance Method Summary
collapse
#canonicalize, included
Methods inherited from Content
#author=, #author_name, find_already_published, #rss_description, search_with, #short_url, #shorten_url, #whiteboard
#default_text_filter, #excerpt_text, #generate_html, #html, #html_map, #html_postprocess, included, #really_send_notifications, #send_notification_to_user, #text_filter
Class Method Details
.default_order ⇒ Object
21
22
23
|
# File 'app/models/page.rb', line 21
def self.default_order
"title ASC"
end
|
Instance Method Details
#permalink_url(anchor = nil, only_path = false) ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'app/models/page.rb', line 25
def permalink_url(anchor = nil, only_path = false)
blog.url_for(
controller: "/articles",
action: "view_page",
name: name,
anchor: anchor,
only_path: only_path)
end
|
#publish! ⇒ Object
34
35
36
37
|
# File 'app/models/page.rb', line 34
def publish!
self.state = "published"
save!
end
|
#published? ⇒ Boolean
39
40
41
|
# File 'app/models/page.rb', line 39
def published?
state == "published"
end
|
#set_permalink ⇒ Object
15
16
17
|
# File 'app/models/page.rb', line 15
def set_permalink
self.name = title.to_permalink if name.blank?
end
|