diff --git a/.rubocop.yml b/.rubocop.yml index 65f43eb..39aaeaa 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,6 +4,9 @@ AllCops: - db/seeds.rb - bin/**/* +Style/AndOr: + Enabled: false + Style/ClassAndModuleChildren: Exclude: - test/test_helper.rb diff --git a/app/controllers/candidate_controller.rb b/app/controllers/candidate_controller.rb index f7ee689..b23d3b2 100644 --- a/app/controllers/candidate_controller.rb +++ b/app/controllers/candidate_controller.rb @@ -9,8 +9,7 @@ class CandidateController < ApplicationController end def update_question - - redirect_to saved_path if params[:submit] == 'Save' + redirect_to :saved and return if params[:save] == 'Save' redirect_to :question end @@ -26,4 +25,10 @@ class CandidateController < ApplicationController def validate redirect_to :question end + + private + + def question_params + params.permit(:save) + end end diff --git a/app/views/candidate/question.html.erb b/app/views/candidate/question.html.erb index b8a1bed..9ff5295 100644 --- a/app/views/candidate/question.html.erb +++ b/app/views/candidate/question.html.erb @@ -5,7 +5,6 @@ content_for :footer_title, "Skills Assessment" %> -
<%= form_tag(post_question_path) do %>

<%= @question.question %>

diff --git a/config/routes.rb b/config/routes.rb index 36bef86..1868c84 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,11 +3,10 @@ Rails.application.routes.draw do get "/thankyou", to: "candidate#thankyou", as: :thankyou get "/saved", to: "candidate#saved", as: :saved get "/summary", to: "candidate#summary", as: :summary - get "/question", to: "candidate#question", as: :question post "/question", to: "candidate#update_question", as: :post_question + get "/question", to: "candidate#question", as: :question post "/validate", to: "candidate#validate", as: :validate_candidate - root to: "candidate#welcome" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/erd.pdf b/erd.pdf index b7f2f8b..9513737 100644 Binary files a/erd.pdf and b/erd.pdf differ