Zone Created_at Bug Fix
This commit is contained in:
@@ -28,12 +28,12 @@ class Settings::TablesController < ApplicationController
|
||||
@settings_table = Table.new(settings_table_params)
|
||||
@settings_table.type = DiningFacility::TABLE_TYPE
|
||||
@settings_table.zone_id = params[:zone_id]
|
||||
@settings_table.created_by = current_login_employee.name
|
||||
respond_to do |format|
|
||||
if @settings_table.save
|
||||
format.html { redirect_to settings_zone_tables_path, notice: 'Table was successfully created.' }
|
||||
format.html { redirect_to settings_zone_path(@zone), notice: 'Table was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_table }
|
||||
else
|
||||
puts "abc"
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_table.errors, status: :unprocessable_entity }
|
||||
end
|
||||
@@ -43,9 +43,10 @@ class Settings::TablesController < ApplicationController
|
||||
# PATCH/PUT /settings/tables/1
|
||||
# PATCH/PUT /settings/tables/1.json
|
||||
def update
|
||||
@settings_table.created_by = current_login_employee.name
|
||||
respond_to do |format|
|
||||
if @settings_table.update(settings_table_params)
|
||||
format.html { redirect_to settings_zone_tables_path, notice: 'Table was successfully updated.' }
|
||||
format.html { redirect_to settings_zone_path(@zone), notice: 'Table was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_table }
|
||||
else
|
||||
format.html { render :edit }
|
||||
@@ -59,7 +60,7 @@ class Settings::TablesController < ApplicationController
|
||||
def destroy
|
||||
@settings_table.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_zones_path, notice: 'Table was successfully destroyed.' }
|
||||
format.html { redirect_to settings_zone_path(@zone), notice: 'Table was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user