Class: Alchemy::EssenceHtml
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Alchemy::EssenceHtml
- Defined in:
- app/models/alchemy/essence_html.rb
Instance Method Summary collapse
-
#preview_text(maxlength = 30) ⇒ Object
Returns the first x (default = 30) (HTML escaped) characters from self.source for the Element#preview_text method.
Instance Method Details
#preview_text(maxlength = 30) ⇒ Object
Returns the first x (default = 30) (HTML escaped) characters from self.source for the Element#preview_text method.
18 19 20 |
# File 'app/models/alchemy/essence_html.rb', line 18 def preview_text(maxlength = 30) ::CGI.escapeHTML(source.to_s)[0..maxlength] end |