table management fixes
This commit is contained in:
@@ -132,11 +132,11 @@ module Suppliers
|
||||
def arrange_tables
|
||||
@section = Section.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
|
||||
case params[:option]
|
||||
when 'distributed' then @section.arrange_tables_in_grid
|
||||
when 'by_row' then @section.arrange_tables_in_rows_of(params[:row_count].to_i)
|
||||
when 'by_column' then @section.arrange_tables_in_columns_of(params[:column_count].to_i)
|
||||
when 'distributed' then render(json: (@section.arrange_tables_in_grid ? {ok: true} : json_alert('messages.could_not_arrange_tables_distributed')))
|
||||
when 'by_row' then render(json: (@section.arrange_tables_in_rows_of(params[:row_count].to_i) ? {ok: true} : json_alert('messages.could_not_arrange_tables_by_row')))
|
||||
when 'by_column' then render(json: (@section.arrange_tables_in_columns_of(params[:column_count].to_i) ? {ok: true} : json_alert('messages.could_not_arrange_tables_by_column')))
|
||||
else render(json: json_alert('messages.could_not_arrange_tables'))
|
||||
end
|
||||
render json: {ok: true}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user