mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-13 09:00:25 -07:00
chore: remove examples models and views
This commit is contained in:
parent
0f525cf2e8
commit
e97b39ec48
20 changed files with 37 additions and 501 deletions
|
|
@ -1,60 +0,0 @@
|
|||
module Dashboard
|
||||
class ExamplesController < ApplicationController
|
||||
before_action :set_example, only: %i[ show edit update destroy ]
|
||||
|
||||
# GET /examples
|
||||
def index
|
||||
@examples = Example.all
|
||||
end
|
||||
|
||||
# GET /examples/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /examples/new
|
||||
def new
|
||||
@example = Example.new
|
||||
end
|
||||
|
||||
# GET /examples/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /examples
|
||||
def create
|
||||
@example = Example.new(example_params)
|
||||
|
||||
if @example.save
|
||||
redirect_to @example, notice: "Example was successfully created."
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /examples/1
|
||||
def update
|
||||
if @example.update(example_params)
|
||||
redirect_to @example, notice: "Example was successfully updated.", status: :see_other
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /examples/1
|
||||
def destroy
|
||||
@example.destroy!
|
||||
redirect_to examples_url, notice: "Example was successfully destroyed.", status: :see_other
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_example
|
||||
@example = Example.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def example_params
|
||||
params.require(:example).permit(:text, :body)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue