Worked on layout, added model funktions, changed database
Changes to the migration file make it necessary to reimport the database: db:drop, db:create, db:migrate, db:seed
This commit is contained in:
@@ -3,7 +3,7 @@ class JobsController < ApplicationController
|
||||
|
||||
# GET /jobs or /jobs.json
|
||||
def index
|
||||
@jobs = Job.all
|
||||
@jobs = Job.current_jobs
|
||||
end
|
||||
|
||||
# GET /jobs/1 or /jobs/1.json
|
||||
@@ -23,7 +23,7 @@ class JobsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @job.save
|
||||
format.html { redirect_to job_url(@job), notice: 'Job was successfully created.' }
|
||||
format.html { redirect_to jobs_url(Job.current_jobs), notice: 'Job was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @job }
|
||||
else
|
||||
format.html { render :new, status: :unprocessable_entity }
|
||||
@@ -65,6 +65,8 @@ class JobsController < ApplicationController
|
||||
# Only allow a list of trusted parameters through.
|
||||
def job_params
|
||||
params.require(:job).permit(:operator_id, :costumer_id, :operator_firstname, :operator_lastname,
|
||||
:costumer_firstname, :costumer_lastname, :paid, :printed_at, :intern, :cost_center, :number_of_plans_a0, :number_of_plans_a1, :number_of_plans_a2, :number_of_plans_a3, :costum_qm_plan)
|
||||
:costumer_firstname, :costumer_lastname, :paid, :printed_at, :intern,
|
||||
:cost_center, :number_of_plans_a0, :number_of_plans_a1,
|
||||
:number_of_plans_a2, :number_of_plans_a3, :costum_qm_plan)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user