Module: Homeland::TopicsHelper
- Defined in:
- app/helpers/homeland/topics_helper.rb
Instance Method Summary collapse
- #format_topic_body(text, title = "", allow_image = true) ⇒ Object
- #render_topic_node_select_tag(topic, opts = {}) ⇒ Object
Instance Method Details
#format_topic_body(text, title = "", allow_image = true) ⇒ Object
4 5 6 7 |
# File 'app/helpers/homeland/topics_helper.rb', line 4 def format_topic_body(text,title = "",allow_image = true) text.gsub!(/\!\[(.+?|)\]\((http:\/\/.+?)\)/i,'<img src="\2" alt="\1" />') auto_link(simple_format(text),:all, :target => '_blank', :rel => "nofollow") end |
#render_topic_node_select_tag(topic, opts = {}) ⇒ Object
9 10 11 12 |
# File 'app/helpers/homeland/topics_helper.rb', line 9 def render_topic_node_select_tag(topic, opts = {}) return "" if topic.blank? grouped_collection_select(:topic, :node_id, Section.all,:sorted_nodes, :name, :id, :name, {:value => topic.node_id, :include_blank => false}, opts) end |