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
652eb105
Commit
652eb105
authored
Jun 04, 2021
by
Mai Hoang Thai Ha
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rails-flavored-ruby' into 'master'
Rails flavored ruby See merge request
!3
parents
aec08413
73b919d4
Pipeline
#1230
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
5 deletions
+16
-5
app/helpers/application_helper.rb
+11
-1
app/views/layouts/application.html.erb
+2
-2
app/views/static_pages/home.html.erb
+0
-1
test/controllers/static_pages_controller_test.rb
+1
-1
test/test_helper.rb
+2
-0
No files found.
app/helpers/application_helper.rb
View file @
652eb105
module
ApplicationHelper
module
ApplicationHelper
end
# Returns the full title on a per-page basis
def
full_title
(
page_title
=
''
)
base_title
=
'Ruby on Rails Tutorial Sample App'
if
page_title
.
empty?
base_title
else
page_title
+
" | "
+
base_title
end
end
end
\ No newline at end of file
app/views/layouts/application.html.erb
View file @
652eb105
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
<%=
yield
(
:title
)
%>
| Ruby on Rails Tutorial Sample App
</title>
<title>
<%=
full_title
(
yield
(
:title
))
%>
</title>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1"
>
<meta
charset=
"utf-8"
name=
"viewport"
content=
"width=device-width,initial-scale=1"
>
<%=
csrf_meta_tags
%>
<%=
csrf_meta_tags
%>
<%=
csp_meta_tag
%>
<%=
csp_meta_tag
%>
...
...
app/views/static_pages/home.html.erb
View file @
652eb105
<%
provide
(
:title
,
"Home"
)
%>
<h1>
Sample App
</h1>
<h1>
Sample App
</h1>
<p>
<p>
...
...
test/controllers/static_pages_controller_test.rb
View file @
652eb105
...
@@ -11,7 +11,7 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
...
@@ -11,7 +11,7 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
test
"should get home"
do
test
"should get home"
do
get
static_pages_home_url
get
static_pages_home_url
assert_response
:success
assert_response
:success
assert_select
"title"
,
"
Home |
#{
@base_title
}
"
assert_select
"title"
,
"
#{
@base_title
}
"
end
end
test
"should get help"
do
test
"should get help"
do
...
...
test/test_helper.rb
View file @
652eb105
ENV
[
'RAILS_ENV'
]
||=
'test'
ENV
[
'RAILS_ENV'
]
||=
'test'
require_relative
"../config/environment"
require_relative
"../config/environment"
require
"rails/test_help"
require
"rails/test_help"
require
"minitest/reporters"
Minitest
::
Reporters
.
use!
class
ActiveSupport
::
TestCase
class
ActiveSupport
::
TestCase
# Run tests in parallel with specified workers
# Run tests in parallel with specified workers
...
...
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