Fix create_collection in FinancialTransactionsController

This commit is contained in:
Patrick Gansterer 2018-12-10 15:32:56 +01:00
parent a2188cb6b8
commit 52323b98b8
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class Finance::FinancialTransactionsController < ApplicationController
def create_collection
raise I18n.t('finance.financial_transactions.controller.create_collection.error_note_required') if params[:note].blank?
type = FinancialTransactionType.find_by_id(params.permit(:type))
type = FinancialTransactionType.find_by_id(params[:type_id])
params[:financial_transactions].each do |trans|
# ignore empty amount fields ...
unless trans[:amount].blank?

View File

@ -37,7 +37,7 @@
- if FinancialTransactionType.has_multiple_types
%p
%b= heading_helper FinancialTransaction, :financial_transaction_type
= select_tag :type, options_for_select(FinancialTransactionType.order(:name).map { |t| [ t.name, t.id ] }, params[:type])
= select_tag :type_id, options_for_select(FinancialTransactionType.order(:name).map { |t| [ t.name, t.id ] }, params[:type_id])
%p
%b= heading_helper FinancialTransaction, :note
= text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required'