diff --git a/app/controllers/charges_controller.rb b/app/controllers/charges_controller.rb index e87c2e17..0259c3bb 100644 --- a/app/controllers/charges_controller.rb +++ b/app/controllers/charges_controller.rb @@ -59,6 +59,7 @@ def new # GET /charges/1/edit def edit + @current_receiving_participant = @charge.receiving_participant.nil? ? "" : @charge.receiving_participant.formatted_name end # POST /charges @@ -76,7 +77,7 @@ def create # PUT /charges/1.json def update @charge.is_approved = false - @charge.update(charge_params) + @charge.update_attributes(charge_params) respond_with(@charge) end @@ -96,7 +97,8 @@ def destroy def approve @charge.is_approved = !@charge.is_approved @charge.save - respond_with @charge, location: -> {charges_path} + + respond_with(@charge, location: @charge.organization) end private diff --git a/app/views/charges/_form.html.erb b/app/views/charges/_form.html.erb index 374d0e3d..2b7648d1 100644 --- a/app/views/charges/_form.html.erb +++ b/app/views/charges/_form.html.erb @@ -20,11 +20,14 @@ When adding a charge, please ensure that you add a detailed description. This al <%= f.input_field :amount, :as => :string %> <% end %> + <%= f.input :description, :as => :text, textarea: "{ font-size:16px; }" %> + <%= f.association :issuing_participant, :collection => Participant.scc %> + <%= f.input :receiving_participant do %> <%= f.input_field :receiving_participant_id, as: :hidden %> - <%= text_field_tag 'card-number-input', nil, class: 'form-control' %> + <%= text_field_tag 'card-number-input', nil, placeholder: @current_receiving_participant, class: 'form-control'%>
<% end %> diff --git a/test/unit/event_type_test.rb b/test/unit/event_type_test.rb index 7c3a828c..2d2877ab 100644 --- a/test/unit/event_type_test.rb +++ b/test/unit/event_type_test.rb @@ -9,6 +9,7 @@ # **`display`** | `boolean` | # **`id`** | `integer` | `not null, primary key` # **`name`** | `string(255)` | +# **`priority`** | `integer` | # class EventTypeTest < ActiveSupport::TestCase @@ -16,4 +17,4 @@ class EventTypeTest < ActiveSupport::TestCase should have_many(:events) -end \ No newline at end of file +end