Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
NSCCS-1 Added welcome controll#index page as root
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneCapella committed Apr 23, 2021
1 parent eb081de commit f7a4d81
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/assets/stylesheets/welcome.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Place all the styles related to the Welcome controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/

body {
color: blue;
}

h1 {
color: green;
}
5 changes: 5 additions & 0 deletions app/controllers/welcome_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class WelcomeController < ApplicationController
def index

end
end
2 changes: 2 additions & 0 deletions app/helpers/welcome_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module WelcomeHelper
end
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>ClubWebsite</title>
<title>Praise the Loaf</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
Expand All @@ -11,6 +11,8 @@
</head>

<body>
<h1>This is the application.html.erb file</h1>
<p>all code below this is written in app/views/welcome/index.html.erb</p>
<%= yield %>
</body>
</html>
2 changes: 2 additions & 0 deletions app/views/welcome/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Welcome#index</h1>
<p>Find me in app/views/welcome/index.html.erb</p>
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Rails.application.routes.draw do
root 'welcome#index'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html

get "/welcome", to: "welcome#index"
end
8 changes: 8 additions & 0 deletions test/controllers/welcome_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "test_helper"

class WelcomeControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get welcome_index_url
assert_response :success
end
end

0 comments on commit f7a4d81

Please sign in to comment.