Module: MongoidForums::ApplicationHelper
- Includes:
- FormattingHelper
- Defined in:
- app/helpers/mongoid_forums/application_helper.rb
Instance Method Summary collapse
-
#mongoid_forums_format(text, *options) ⇒ Object
processes text with installed markup formatter.
- #mongoid_forums_markdown(text, *options) ⇒ Object
- #mongoid_forums_quote(text) ⇒ Object
Methods included from FormattingHelper
#as_formatted_html, #as_quoted_text, #as_sanitized_text
Instance Method Details
#mongoid_forums_format(text, *options) ⇒ Object
processes text with installed markup formatter
5 6 7 8 9 10 11 |
# File 'app/helpers/mongoid_forums/application_helper.rb', line 5 def mongoid_forums_format(text, *) text = text.gsub(URI::regexp){ |url| url = Addressable::URI.parse(url).normalize "<a href='#{url}'>#{url.display_uri}</a>" }.html_safe as_formatted_html(text) end |
#mongoid_forums_markdown(text, *options) ⇒ Object
17 18 19 20 21 |
# File 'app/helpers/mongoid_forums/application_helper.rb', line 17 def mongoid_forums_markdown(text, *) #TODO: delete deprecated method Rails.logger.warn("DEPRECATION: mongoid_forums_markdown is replaced by mongoid_forums_format(), and will be removed") forem_format(text) end |
#mongoid_forums_quote(text) ⇒ Object
13 14 15 |
# File 'app/helpers/mongoid_forums/application_helper.rb', line 13 def mongoid_forums_quote(text) as_quoted_text(text) end |