-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from hpi-swt2/dev
Deployment #3
- Loading branch information
Showing
63 changed files
with
1,099 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#routing-controller { | ||
width: 100%; | ||
padding: 5px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Place all the styles related to the Courses controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: https://sass-lang.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
class CoursesController < ApplicationController | ||
before_action :set_course, only: %i[show edit update destroy] | ||
|
||
# GET /courses or /courses.json | ||
def index | ||
@courses = Course.all | ||
end | ||
|
||
# GET /courses/1 or /courses/1.json | ||
def show; end | ||
|
||
# GET /courses/new | ||
def new | ||
@course = Course.new | ||
end | ||
|
||
# GET /courses/1/edit | ||
def edit; end | ||
|
||
# POST /courses or /courses.json | ||
def create | ||
@course = Course.new(course_params) | ||
|
||
respond_to do |format| | ||
if @course.save | ||
format.html { redirect_to course_url(@course), notice: "Course was successfully created." } | ||
format.json { render :show, status: :created, location: @course } | ||
else | ||
format.html { render :new, status: :unprocessable_entity } | ||
format.json { render json: @course.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PATCH/PUT /courses/1 or /courses/1.json | ||
def update | ||
respond_to do |format| | ||
if @course.update(course_params) | ||
format.html { redirect_to course_url(@course), notice: "Course was successfully updated." } | ||
format.json { render :show, status: :ok, location: @course } | ||
else | ||
format.html { render :edit, status: :unprocessable_entity } | ||
format.json { render json: @course.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /courses/1 or /courses/1.json | ||
def destroy | ||
@course.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to courses_url, notice: "Course was successfully destroyed." } | ||
format.json { head :no_content } | ||
end | ||
end | ||
|
||
private | ||
|
||
# Use callbacks to share common setup or constraints between actions. | ||
def set_course | ||
@course = Course.find(params[:id]) | ||
end | ||
|
||
# Only allow a list of trusted parameters through. | ||
def course_params | ||
params.require(:course).permit(:name, :module_category, :exam_date) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module CoursesHelper | ||
end |
Oops, something went wrong.