Files
grecia/app/controllers/admin/proposals_controller.rb
Javi Martín 82b0a6a92d Remove new CSV report generation
The new CSV report was more configurable and could work on proposals,
processes and comments. However, it had several issues.

In the public area, by default it generated a blank file.

In the admin section, the report was hard to configure and it generated
a file with less quality than the old system.

So until we improve this system, we're bringing back the old investment
CSV exporter.

This commit reverts most of commit 9d1ca3bf.
2019-11-06 00:04:02 +01:00

41 lines
742 B
Ruby

class Admin::ProposalsController < Admin::BaseController
include HasOrders
include CommentableActions
include FeatureFlags
feature_flag :proposals
has_orders %w[created_at]
before_action :load_proposal, except: :index
def show
end
def update
if @proposal.update(proposal_params)
redirect_to admin_proposal_path(@proposal), notice: t("admin.proposals.update.notice")
else
render :show
end
end
def toggle_selection
@proposal.toggle :selected
@proposal.save!
end
private
def resource_model
Proposal
end
def load_proposal
@proposal = Proposal.find(params[:id])
end
def proposal_params
params.require(:proposal).permit(:selected)
end
end