84 lines
2.3 KiB
Ruby
84 lines
2.3 KiB
Ruby
|
class SoftapplicationsController < ApplicationController
|
||
|
# GET /softapplications
|
||
|
# GET /softapplications.json
|
||
|
def index
|
||
|
@softapplications = Softapplication.all
|
||
|
|
||
|
respond_to do |format|
|
||
|
format.html # index.html.erb
|
||
|
format.json { render json: @softapplications }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# GET /softapplications/1
|
||
|
# GET /softapplications/1.json
|
||
|
def show
|
||
|
@softapplication = Softapplication.find(params[:id])
|
||
|
|
||
|
respond_to do |format|
|
||
|
format.html # show.html.erb
|
||
|
format.json { render json: @softapplication }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# GET /softapplications/new
|
||
|
# GET /softapplications/new.json
|
||
|
def new
|
||
|
@softapplication = Softapplication.new
|
||
|
|
||
|
respond_to do |format|
|
||
|
format.html # new.html.erb
|
||
|
format.json { render json: @softapplication }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# GET /softapplications/1/edit
|
||
|
def edit
|
||
|
@softapplication = Softapplication.find(params[:id])
|
||
|
end
|
||
|
|
||
|
# POST /softapplications
|
||
|
# POST /softapplications.json
|
||
|
def create
|
||
|
@softapplication = Softapplication.new(params[:softapplication])
|
||
|
|
||
|
respond_to do |format|
|
||
|
if @softapplication.save
|
||
|
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' }
|
||
|
format.json { render json: @softapplication, status: :created, location: @softapplication }
|
||
|
else
|
||
|
format.html { render action: "new" }
|
||
|
format.json { render json: @softapplication.errors, status: :unprocessable_entity }
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# PUT /softapplications/1
|
||
|
# PUT /softapplications/1.json
|
||
|
def update
|
||
|
@softapplication = Softapplication.find(params[:id])
|
||
|
|
||
|
respond_to do |format|
|
||
|
if @softapplication.update_attributes(params[:softapplication])
|
||
|
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully updated.' }
|
||
|
format.json { head :no_content }
|
||
|
else
|
||
|
format.html { render action: "edit" }
|
||
|
format.json { render json: @softapplication.errors, status: :unprocessable_entity }
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# DELETE /softapplications/1
|
||
|
# DELETE /softapplications/1.json
|
||
|
def destroy
|
||
|
@softapplication = Softapplication.find(params[:id])
|
||
|
@softapplication.destroy
|
||
|
|
||
|
respond_to do |format|
|
||
|
format.html { redirect_to softapplications_url }
|
||
|
format.json { head :no_content }
|
||
|
end
|
||
|
end
|
||
|
end
|