From b3259ad00cded85e88af204911bfc6426f4d55aa Mon Sep 17 00:00:00 2001 From: Chris Howlett Date: Sun, 13 Mar 2016 10:03:50 +0000 Subject: [PATCH] Ensure inserted journals are marked Modified For #128 --- app/controllers/journals_controller.rb | 2 +- app/views/games/show.html.slim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index c3662007..1fda9c4e 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -75,6 +75,6 @@ def set_journal # Only allow a trusted parameter "white list" through. def journal_params - params[:journal].permit :game_id, :event, :order + params[:journal].permit :game_id, :event, :order, :modified end end diff --git a/app/views/games/show.html.slim b/app/views/games/show.html.slim index cfe0dce5..5eb6785f 100644 --- a/app/views/games/show.html.slim +++ b/app/views/games/show.html.slim @@ -45,7 +45,7 @@ h2= @game.name { var newLi = $('
  • ').insertBefore($(this).parent()); //' var bipField = $("#{escape_javascript best_in_place(Journal.new, :event, class: 'change_journal', method: 'post', html_attrs: {style: 'width: 100%', autocomplete: 'off'})}"); - bipField.attr('data-bip-other-fields', $.param({journal: {order: $(this).data('order')}})); + bipField.attr('data-bip-other-fields', $.param({game_id: #{@game.id}, journal: {modified: true, order: $(this).data('order')}})); bipField.insertAfter(newLi); bipField.best_in_place().click(); });