Module: Irwi::Extensions::Controllers::WikiPageAttachments

Included in:
Irwi::Extensions::Controllers::WikiPages::InstanceMethods
Defined in:
lib/irwi/extensions/controllers/wiki_page_attachments.rb

Instance Method Summary collapse

Instance Method Details

#add_attachmentObject



3
4
5
6
7
# File 'lib/irwi/extensions/controllers/wiki_page_attachments.rb', line 3

def add_attachment
  attachment = page_attachment_class.new(params[:wiki_page_attachment])
  attachment.save
  redirect_to url_for( :action => :edit)
end

#remove_attachmentObject



9
10
11
12
13
# File 'lib/irwi/extensions/controllers/wiki_page_attachments.rb', line 9

def remove_attachment
  attachment = page_attachment_class.find(params[:attachment_id])
  attachment.destroy
  redirect_to url_for(:path => attachment.page.path, :action => :edit)
end