summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 21:00:52 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 21:00:52 +0100
commite76890d5f4634d47514a592d501d9792ae2ff7bb (patch)
tree0d257877fa5e5ba295affefd8fe76d3d3954996e /app/controllers
parent4b8dfcded36e1162346ee029d4bfc9c94323bdde (diff)
Different scaffold for GsParameter.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/gs_parameters_controller.rb66
1 files changed, 12 insertions, 54 deletions
diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb
index d6a92c6..be3378e 100644
--- a/app/controllers/gs_parameters_controller.rb
+++ b/app/controllers/gs_parameters_controller.rb
@@ -1,83 +1,41 @@
class GsParametersController < ApplicationController
- # GET /gs_parameters
- # GET /gs_parameters.json
def index
@gs_parameters = GsParameter.all
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @gs_parameters }
- end
end
- # GET /gs_parameters/1
- # GET /gs_parameters/1.json
def show
@gs_parameter = GsParameter.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @gs_parameter }
- end
end
- # GET /gs_parameters/new
- # GET /gs_parameters/new.json
def new
@gs_parameter = GsParameter.new
+ end
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @gs_parameter }
+ def create
+ @gs_parameter = GsParameter.new(params[:gs_parameter])
+ if @gs_parameter.save
+ redirect_to @gs_parameter, :notice => t('gs_parameters.controller.successfuly_created')
+ else
+ render :new
end
end
- # GET /gs_parameters/1/edit
def edit
@gs_parameter = GsParameter.find(params[:id])
end
- # POST /gs_parameters
- # POST /gs_parameters.json
- def create
- @gs_parameter = GsParameter.new(params[:gs_parameter])
-
- respond_to do |format|
- if @gs_parameter.save
- format.html { redirect_to @gs_parameter, notice: 'Gs parameter was successfully created.' }
- format.json { render json: @gs_parameter, status: :created, location: @gs_parameter }
- else
- format.html { render action: "new" }
- format.json { render json: @gs_parameter.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PUT /gs_parameters/1
- # PUT /gs_parameters/1.json
def update
@gs_parameter = GsParameter.find(params[:id])
-
- respond_to do |format|
- if @gs_parameter.update_attributes(params[:gs_parameter])
- format.html { redirect_to @gs_parameter, notice: 'Gs parameter was successfully updated.' }
- format.json { head :no_content }
- else
- format.html { render action: "edit" }
- format.json { render json: @gs_parameter.errors, status: :unprocessable_entity }
- end
+ if @gs_parameter.update_attributes(params[:gs_parameter])
+ redirect_to @gs_parameter, :notice => t('gs_parameters.controller.successfuly_updated')
+ else
+ render :edit
end
end
- # DELETE /gs_parameters/1
- # DELETE /gs_parameters/1.json
def destroy
@gs_parameter = GsParameter.find(params[:id])
@gs_parameter.destroy
-
- respond_to do |format|
- format.html { redirect_to gs_parameters_url }
- format.json { head :no_content }
- end
+ redirect_to gs_parameters_url, :notice => t('gs_parameters.controller.successfuly_destroyed')
end
end