update lookup

This commit is contained in:
Aung Myo
2017-07-31 17:33:06 +06:30
parent bc5a7d01f7
commit b3c77fc28c
6 changed files with 32 additions and 22 deletions

View File

@@ -28,11 +28,11 @@ class Settings::LookupsController < ApplicationController
respond_to do |format|
if @settings_lookup.save
format.html { redirect_to @settings_lookup, notice: 'Lookup was successfully created.' }
format.html { redirect_to settings_lookups_path, notice: 'Lookup was successfully created.' }
format.json { render :show, status: :created, location: @settings_lookup }
else
format.html { render :new }
format.json { render json: @settings_lookup.errors, status: :unprocessable_entity }
format.json { render json: settings_lookups_path.errors, status: :unprocessable_entity }
end
end
end
@@ -42,11 +42,11 @@ class Settings::LookupsController < ApplicationController
def update
respond_to do |format|
if @settings_lookup.update(settings_lookup_params)
format.html { redirect_to @settings_lookup, notice: 'Lookup was successfully updated.' }
format.html { redirect_to settings_lookups_path, notice: 'Lookup was successfully updated.' }
format.json { render :show, status: :ok, location: @settings_lookup }
else
format.html { render :edit }
format.json { render json: @settings_lookup.errors, status: :unprocessable_entity }
format.json { render json: settings_lookups_path.errors, status: :unprocessable_entity }
end
end
end
@@ -56,7 +56,7 @@ class Settings::LookupsController < ApplicationController
def destroy
@settings_lookup.destroy
respond_to do |format|
format.html { redirect_to settings_lookups_url, notice: 'Lookup was successfully destroyed.' }
format.html { redirect_to settings_lookups_path, notice: 'Lookup was successfully destroyed.' }
format.json { head :no_content }
end
end