only show instance attribute in menu item selected
This commit is contained in:
@@ -154,6 +154,9 @@ class Settings::MenuItemInstancesController < ApplicationController
|
|||||||
else
|
else
|
||||||
@item = MenuItem.find(params[:set_menu_item_id])
|
@item = MenuItem.find(params[:set_menu_item_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# To Only show in Menu item selected attrs
|
||||||
|
@item.item_attributes = MenuItemAttribute.where(id: @item.item_attributes).select("id, name").map { |e| [e.name, e.id] }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<%= f.input :item_instance_name %>
|
<%= f.input :item_instance_name %>
|
||||||
<%= f.input :price %>
|
<%= f.input :price %>
|
||||||
|
|
||||||
<%= f.input :item_attributes, collection: MenuItemAttribute.collection, input_html: { multiple: true } %>
|
<%= f.input :item_attributes, collection: @item.item_attributes, input_html: { multiple: true } %>
|
||||||
|
|
||||||
<%= f.input :is_on_promotion %>
|
<%= f.input :is_on_promotion %>
|
||||||
<%= f.input :promotion_price %>
|
<%= f.input :promotion_price %>
|
||||||
|
|||||||
@@ -107,7 +107,9 @@
|
|||||||
|
|
||||||
<td><%= settings_menu_item.item_instance_code %></td>
|
<td><%= settings_menu_item.item_instance_code %></td>
|
||||||
<td><%= settings_menu_item.item_instance_name %></td>
|
<td><%= settings_menu_item.item_instance_name %></td>
|
||||||
<td><%= settings_menu_item.item_attributes %></td>
|
<td>
|
||||||
|
<%= MenuItemAttribute.where(id: settings_menu_item.item_attributes).pluck(:name) %>
|
||||||
|
</td>
|
||||||
<td><%= settings_menu_item.price %></td>
|
<td><%= settings_menu_item.price %></td>
|
||||||
<!-- <td><%= settings_menu_item.is_on_promotion %></td> -->
|
<!-- <td><%= settings_menu_item.is_on_promotion %></td> -->
|
||||||
<td><%= settings_menu_item.promotion_price %></td>
|
<td><%= settings_menu_item.promotion_price %></td>
|
||||||
|
|||||||
Reference in New Issue
Block a user