From 3caca02804237da5a2ef2a0d8ac1e2e149340cc7 Mon Sep 17 00:00:00 2001 From: ShuzoN Date: Sun, 28 Aug 2016 15:58:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?upd:=20activeadmin=E3=81=AEindex=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E3=81=8B=E3=82=89=E7=AE=A1=E7=90=86=E7=94=A8index(rai?= =?UTF-8?q?ls=20view)=E3=81=AB=E7=A7=BB=E5=8B=95=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/assign_rental_item.rb | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/app/admin/assign_rental_item.rb b/app/admin/assign_rental_item.rb index 3cdc472c..0d526d70 100644 --- a/app/admin/assign_rental_item.rb +++ b/app/admin/assign_rental_item.rb @@ -1,22 +1,19 @@ ActiveAdmin.register AssignRentalItem do + permit_params :rental_order_id, :rentable_item_id, :num - # See permitted parameters documentation: - # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters - # - # permit_params :list, :of, :attributes, :on, :model - # - # or - # - # permit_params do - # permitted = [:permitted, :attributes] - # permitted << :other if resource.something? - # permitted - # end - permit_params :rental_order_id, :rentable_item_id, :num + action_item only: :index do + link_to '物品割当画面に移動', assign_rental_items_path + end + + index do + panel 'Notice' do + '右上の「物品割当画面に移動」ボタンから物品管理を行ってください. 管理画面からの編集は非推奨です.' + end + selectable_column id_column column :rental_order From d3356a5f8c41b8adc586ac806c84dfae74dee6ba Mon Sep 17 00:00:00 2001 From: ShuzoN Date: Sun, 28 Aug 2016 16:30:47 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix=20:=20=E7=89=A9=E5=93=81=E8=B2=B8?= =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=8A=9B=E7=94=BB=E9=9D=A2=E3=81=AEcol?= =?UTF-8?q?=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F=E3=81=AA=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E9=83=A8=E5=88=86=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assign_rental_items/item_list.html.erb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/assign_rental_items/item_list.html.erb b/app/views/assign_rental_items/item_list.html.erb index 561272e9..d52c79db 100644 --- a/app/views/assign_rental_items/item_list.html.erb +++ b/app/views/assign_rental_items/item_list.html.erb @@ -4,10 +4,10 @@ + + <% @rentables.each do |rentable| %> - - - + <% end %> @@ -19,13 +19,13 @@ <% @rentables.each do |rentable| %> <% assign = AssignRentalItem.where(rental_order_id: order) - .where(rentable_item_id: rentable).first() %> - - + - <% end %> + edit_assign_rental_item_path(assign), :class => 'btn btn-default btn-xs' %> + + <% end %> <% end %>
<%= Group.model_name.human.pluralize.titleize %><%= RentalOrder.human_attribute_name(:num) %><%= Group.model_name.human.pluralize.titleize %><%= RentalOrder.human_attribute_name(:num) %><%= rentable.to_s %>の割当
<%= rentable.to_s %>の割当
<%=t '.actions', :default => t("helpers.actions") %>
<%= order.num %><%= assign.num %> + .where(rentable_item_id: rentable).first() %> +
<%= assign.num %>
<%= link_to t('.edit', :default => t("helpers.links.edit")), - edit_assign_rental_item_path(assign), :class => 'btn btn-default btn-xs' %> -