Sha256: a83893594a96066eeec1a914e0cddd5626a2f6381bbd6c0923164e38ac657a4d
Contents?: true
Size: 539 Bytes
Versions: 2
Compression:
Stored size: 539 Bytes
Contents
module Irwi::Extensions::Controllers::WikiPageAttachments def add_attachment attachment = page_attachment_class.new(params[:wiki_page_attachment]) attachment.save redirect_to url_for(:path => attachment.page.path, :action => :edit) end def remove_attachment attachment = page_attachment_class.find(params[:attachment_id]) attachment.destroy redirect_to url_for(:path => attachment.page.path, :action => :edit) end protected def page_attachment_class Irwi.config.page_attachment_class end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
irwi-0.4.2 | lib/irwi/extensions/controllers/wiki_page_attachments.rb |
irwi-0.4.1 | lib/irwi/extensions/controllers/wiki_page_attachments.rb |