Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions app/admin/assign_rental_item.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 9 additions & 9 deletions app/views/assign_rental_items/item_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<table class="table table-striped">
<thead>
<tr>
<th><%= Group.model_name.human.pluralize.titleize %></th>
<th><%= RentalOrder.human_attribute_name(:num) %></th>
<% @rentables.each do |rentable| %>
<th><%= Group.model_name.human.pluralize.titleize %></th>
<th><%= RentalOrder.human_attribute_name(:num) %></th>
<th><%= rentable.to_s %>の割当</th>
<th><center><%= rentable.to_s %>の割当</center></th>
<th><%=t '.actions', :default => t("helpers.actions") %></th>
<% end %>
</tr>
Expand All @@ -19,13 +19,13 @@
<td><%= order.num %></td>
<% @rentables.each do |rentable| %>
<% assign = AssignRentalItem.where(rental_order_id: order)
.where(rentable_item_id: rentable).first() %>
<td><%= assign.num %></td>
<td>
.where(rentable_item_id: rentable).first() %>
<td><center><%= assign.num %></center></td>
<td><center>
<%= link_to t('.edit', :default => t("helpers.links.edit")),
edit_assign_rental_item_path(assign), :class => 'btn btn-default btn-xs' %>
</td>
<% end %>
edit_assign_rental_item_path(assign), :class => 'btn btn-default btn-xs' %>
</center></td>
<% end %>
</tr>
<% end %>
</tbody>
Expand Down