A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ElementsController < ApplicationController
|
||||
before_action :set_element, only: %i[show edit update destroy]
|
||||
|
||||
|
|
@ -7,8 +9,7 @@ class ElementsController < ApplicationController
|
|||
end
|
||||
|
||||
# GET /elements/1
|
||||
def show
|
||||
end
|
||||
def show; end
|
||||
|
||||
# GET /elements/new
|
||||
def new
|
||||
|
|
@ -16,8 +17,7 @@ class ElementsController < ApplicationController
|
|||
end
|
||||
|
||||
# GET /elements/1/edit
|
||||
def edit
|
||||
end
|
||||
def edit; end
|
||||
|
||||
# POST /elements
|
||||
def create
|
||||
|
|
@ -28,11 +28,11 @@ class ElementsController < ApplicationController
|
|||
|
||||
if @element.save
|
||||
checklist.checks.each do |check|
|
||||
@element.success_criteria.create!(title: check.name, description_html: check.success_criterion_html,
|
||||
@element.success_criteria.create!(title: check.t_name, description_html: check.t_criterion,
|
||||
level: check.level)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_to @element.report, notice: 'Element was successfully created.' }
|
||||
format.html { redirect_to @element.report, notice: "Element was successfully created." }
|
||||
format.turbo_stream
|
||||
end
|
||||
else
|
||||
|
|
@ -43,7 +43,7 @@ class ElementsController < ApplicationController
|
|||
# PATCH/PUT /elements/1
|
||||
def update
|
||||
if @element.update(element_params)
|
||||
redirect_to @element, notice: 'Element was successfully updated.', status: :see_other
|
||||
redirect_to @element, notice: "Element was successfully updated.", status: :see_other
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
|
|
@ -52,7 +52,7 @@ class ElementsController < ApplicationController
|
|||
# DELETE /elements/1
|
||||
def destroy
|
||||
@element.destroy!
|
||||
redirect_to elements_url, notice: 'Element was successfully destroyed.', status: :see_other
|
||||
redirect_to elements_url, notice: "Element was successfully destroyed.", status: :see_other
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue