initial commit

This commit is contained in:
Senad Uka
2013-12-09 03:23:49 +01:00
parent 9582c13e0c
commit e8751fa215
204 changed files with 6675 additions and 41 deletions

View File

@@ -0,0 +1,45 @@
class ResultsController < ApplicationController
before_action :set_result, only: [:show, :edit, :update, :destroy]
# GET /results
# GET /results.json
def index
@results = Result.all
end
# GET /results/1
# GET /results/1.json
def show
end
# POST /results
# POST /results.json
def create
@result = Result.new(result_params)
respond_to do |format|
if @result.save
format.html { redirect_to @result, notice: 'Result was successfully created.' }
format.json { render action: 'show', status: :created, location: @result }
else
format.html { render action: 'new' }
format.json { render json: @result.errors, status: :unprocessable_entity }
end
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_result
@result = Result.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def result_params
params.require(:result).permit(:user_id, :time)
end
end