Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sample_app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mai Hoang Thai Ha
sample_app
Commits
bf12793f
Commit
bf12793f
authored
Jun 07, 2021
by
Mai Hoang Thai Ha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish layout and routes
parent
218d995d
Pipeline
#1231
failed with stages
in 0 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
app/controllers/static_pages_controller.rb
+3
-0
app/views/static_pages/home.html.erb
+1
-1
config/routes.rb
+5
-5
test/controllers/static_pages_controller_test.rb
+4
-4
No files found.
app/controllers/static_pages_controller.rb
View file @
bf12793f
...
...
@@ -7,4 +7,7 @@ class StaticPagesController < ApplicationController
def
about
end
def
contact
end
end
app/views/static_pages/home.html.erb
View file @
bf12793f
...
...
@@ -5,7 +5,7 @@
<a
href=
"https://www.railstutorial.org/"
>
Ruby on Rails Tutorial
</a>
sample application.
</h2>
<%=
link_to
"Sign up now!"
,
'#'
,
class:
"btn btn-lg btn-primary"
%>
<%=
link_to
"Sign up now!"
,
signup_path
,
class:
"btn btn-lg btn-primary"
%>
</div>
<%=
link_to
image_tag
(
"rails.svg"
,
alt:
"Rails logo"
,
width:
"200"
),
"https://rubyonrails.org"
%>
" %>
config/routes.rb
View file @
bf12793f
Rails
.
application
.
routes
.
draw
do
get
'users/new'
root
'static_pages#home'
get
'static_pages/home'
get
'static_pages/help'
get
'static_pages/about'
get
'static_pages/contact'
get
'static_pages/example'
get
'/help'
,
to:
'static_pages#help'
get
'/about'
,
to:
'static_pages#about'
get
'/contact'
,
to:
'static_pages#contact'
get
'/signup'
,
to:
'users#new'
end
test/controllers/static_pages_controller_test.rb
View file @
bf12793f
...
...
@@ -9,25 +9,25 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
@base_title
=
"Ruby on Rails Tutorial Sample App"
end
test
"should get home"
do
get
static_pages_home_url
get
root_path
assert_response
:success
assert_select
"title"
,
"
#{
@base_title
}
"
end
test
"should get help"
do
get
static_pages_help_url
get
help_path
assert_response
:success
assert_select
"title"
,
"Help |
#{
@base_title
}
"
end
test
"should get about"
do
get
static_pages_about_url
get
about_path
assert_response
:success
assert_select
"title"
,
"About |
#{
@base_title
}
"
end
test
"should get contact"
do
get
static_pages_contact_url
get
contact_path
assert_response
:success
assert_select
"title"
,
"Contact |
#{
@base_title
}
"
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment