Module: Irwi::Helpers::WikiPageAttachmentsHelper
- Included in:
- WikiPagesHelper
- Defined in:
- lib/irwi/helpers/wiki_page_attachments_helper.rb
Instance Method Summary collapse
- #wiki_add_page_attachment_path(page) ⇒ Object
- #wiki_remove_page_attachment_path(attachment_id) ⇒ Object
- #wiki_show_attachments(str) ⇒ Object
Instance Method Details
#wiki_add_page_attachment_path(page) ⇒ Object
3 4 5 6 |
# File 'lib/irwi/helpers/wiki_page_attachments_helper.rb', line 3 def (page) page = page.path if page.respond_to? :path url_for(:action => 'add_attachment', :path => page) end |
#wiki_remove_page_attachment_path(attachment_id) ⇒ Object
8 9 10 |
# File 'lib/irwi/helpers/wiki_page_attachments_helper.rb', line 8 def () url_for(:action => 'remove_attachment', :attachment_id => ) end |
#wiki_show_attachments(str) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/irwi/helpers/wiki_page_attachments_helper.rb', line 12 def (str) str.gsub /Attachment_([\d]+)_([\w]+)/ do |m| begin = Irwi.config..find($1) image_tag ..url($2.to_sym), :class => 'wiki_page_attachment' rescue ActiveRecord::RecordNotFound nil end end end |