diff --git a/app/controllers/finance/financial_transactions_controller.rb b/app/controllers/finance/financial_transactions_controller.rb index 45efeda8..82fca9e0 100644 --- a/app/controllers/finance/financial_transactions_controller.rb +++ b/app/controllers/finance/financial_transactions_controller.rb @@ -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? diff --git a/app/views/finance/financial_transactions/new_collection.html.haml b/app/views/finance/financial_transactions/new_collection.html.haml index b5373733..29a280a1 100644 --- a/app/views/finance/financial_transactions/new_collection.html.haml +++ b/app/views/finance/financial_transactions/new_collection.html.haml @@ -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'