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
5 6 7 8 |
# File 'lib/irwi/helpers/wiki_page_attachments_helper.rb', line 5 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
10 11 12 |
# File 'lib/irwi/helpers/wiki_page_attachments_helper.rb', line 10 def () url_for(:action => 'remove_attachment', :attachment_id => ) end |
#wiki_show_attachments(str) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/irwi/helpers/wiki_page_attachments_helper.rb', line 14 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 |