Make Budget::Investment::Milestone class Documentable.

Add fields to the milestone form so that the admin can attach 0, 1 or multiple documents.
Add column to milestone list with a link to documents (if there is any).
Make documents accessible from the milestone view for users.
This commit is contained in:
iagirre
2017-12-14 10:53:01 +01:00
parent 97f549ac10
commit 01a8c55936
8 changed files with 40 additions and 2 deletions

View File

@@ -41,7 +41,8 @@ class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
def milestone_params
params.require(:budget_investment_milestone)
.permit(:title, :description, :budget_investment_id,
image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy])
image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy])
end
def load_budget_investment