Class: Page
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Page
- Defined in:
- app/models/page.rb
Instance Method Summary collapse
Instance Method Details
#format_markup ⇒ Object
19 20 21 22 23 |
# File 'app/models/page.rb', line 19 def format_markup if not self.body_raw.nil? self.body = RedCloth.new(self.body_raw,[:sanitize_html, :filter_html]).to_html end end |
#published ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/models/page.rb', line 25 def published #self.published_at ||= Time.now unless self.is_active == 0 if self.is_active == 0 if !self.published_at.blank? self.published_at = nil end else if self.published_at.blank? self.published_at = Time.now end end end |
#to_param ⇒ Object
14 15 16 17 |
# File 'app/models/page.rb', line 14 def to_param return permalink unless permalink.blank? title.to_url end |