better lists history

This commit is contained in:
2012-09-07 15:45:18 +02:00
parent 3b29b5b985
commit 7f8a8e9e26
4 changed files with 5 additions and 8 deletions
+1 -6
View File
@@ -6,7 +6,6 @@ class UserController < ApplicationController
def home
handle_message_params
render layout: 'phone'
end
# POST /user/create_list {table_id: 1234}
@@ -52,7 +51,6 @@ class UserController < ApplicationController
respond_to do |format|
format.html do
handle_message_params
render layout: 'phone'
end
format.json do
products = list.supplier.products
@@ -124,7 +122,6 @@ class UserController < ApplicationController
@table = Table.find(params[:table_id])
respond_to do |format|
format.html do
render layout: 'phone'
end
format.json do
products = @table.supplier.products
@@ -143,7 +140,6 @@ class UserController < ApplicationController
respond_to do |format|
format.html do
redirect_to(root_path, alert: t('messages.there_is_no_list_active')) and return unless list.present?
render layout: 'phone'
end
format.json do
render json: list.with_orders_and_join_requests_as_json.merge(supplier_name: list.supplier.name)
@@ -199,7 +195,7 @@ class UserController < ApplicationController
# GET /user/list_history
def list_history
@lists = List.for_user(current_user, page: params[:page], per_page: params[:per_page].presence || 14)
render layout: 'phone'
@lists.include_relation(:supplier)
end
##
@@ -214,7 +210,6 @@ class UserController < ApplicationController
redirect_to user_root_path, alert: t('messages.illegal_history_list_attempt') and return unless @list.user_ids.include?(current_user.id)
respond_to do |format|
format.html do
render layout: 'phone'
end
format.json do
render json: @list.with_orders_as_json