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

Included in:
WikiPages
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(permitted_page_attachment_params)
  attachment.save!
  redirect_to url_for(:path => attachment.page.path, :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