Add max votable headings to groups

This commit is contained in:
rgarcia
2018-03-21 16:44:26 +01:00
parent c1d7378c92
commit 730072e91e
5 changed files with 67 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ class Admin::BudgetGroupsController < Admin::BaseController
private
def budget_group_params
params.require(:budget_group).permit(:name)
params.require(:budget_group).permit(:name, :max_votable_headings)
end
end

View File

@@ -8,6 +8,19 @@
maxlength: 50,
placeholder: t("admin.budgets.form.group"),
class: "input-group-field" %>
<% if group.persisted? %>
<div class="small-12 medium-6 large-4">
<%= f.label :name, t("admin.budgets.form.max_votable_headings") %>
<%= f.select :max_votable_headings,
(1..group.headings.count),
label: false,
placeholder: t("admin.budgets.form.max_votable_headings"),
class: "input-group-field" %>
</div>
<% end %>
<div class="input-group-button">
<%= f.submit button_title, class: "button success" %>
</div>