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 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' %> -