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
1
Merge Requests
1
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
Tan Phat Nguyen
sample_app
Commits
df59f375
Commit
df59f375
authored
Nov 03, 2014
by
Tan Phat Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish static pages
parent
610ab609
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
5 deletions
+44
-5
app/controllers/static_pages_controller.rb
+3
-0
app/views/layouts/application.html.erb
+1
-1
app/views/static_pages/about.html.erb
+12
-0
app/views/static_pages/help.html.erb
+10
-2
app/views/static_pages/home.html.erb
+8
-2
config/routes.rb
+2
-0
test/controllers/static_pages_controller_test.rb
+8
-0
No files found.
app/controllers/static_pages_controller.rb
View file @
df59f375
...
...
@@ -4,4 +4,7 @@ class StaticPagesController < ApplicationController
def
help
end
def
about
end
end
app/views/layouts/application.html.erb
View file @
df59f375
<!DOCTYPE html>
<html>
<head>
<title>
Sample
App
</title>
<title>
<%=
yield
(
:title
)
%>
| Ruby on Rails Tutorial Sample
App
</title>
<%=
stylesheet_link_tag
'application'
,
media:
'all'
,
'data-turbolinks-track'
=>
true
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
=>
true
%>
<%=
csrf_meta_tags
%>
...
...
app/views/static_pages/about.html.erb
0 → 100644
View file @
df59f375
<%
provide
(
:title
,
"About"
)
%>
<h1>
About
</h1>
<p>
The
<a
href=
"http://www.railstutorial.org/"
><em>
Ruby on Rails
Tutorial
</em></a>
is a
<a
href=
"http://www.railstutorial.org/book"
>
book
</a>
and
<a
href=
"http://screencasts.railstutorial.org/"
>
screencast series
</a>
to teach web development with
<a
href=
"http://rubyonrails.org/"
>
Ruby on Rails
</a>
.
This is the sample application for the tutorial.
</p>
\ No newline at end of file
app/views/static_pages/help.html.erb
View file @
df59f375
<h1>
StaticPages#help
</h1>
<p>
Find me in app/views/static_pages/help.html.erb
</p>
<%
provide
(
:title
,
"Help"
)
%>
<h1>
Help
</h1>
<p>
Get help on the Ruby on Rails Tutorial at the
<a
href=
"http://www.railstutorial.org/#help"
>
Rails Tutorial help section
</a>
.
To get help on this sample app, see the
<a
href=
"http://www.railstutorial.org/book"
><em>
Ruby on Rails Tutorial
</em>
book
</a>
.
</p>
\ No newline at end of file
app/views/static_pages/home.html.erb
View file @
df59f375
<h1>
StaticPages#home
</h1>
<p>
Find me in app/views/static_pages/home.html.erb
</p>
<%
provide
(
:title
,
"Home"
)
%>
<h1>
Sample App
</h1>
<p>
This is the home page for the
<a
href=
"http://www.railstutorial.org/"
>
Ruby on Rails Tutorial
</a>
sample application.
</p>
\ No newline at end of file
config/routes.rb
View file @
df59f375
Rails
.
application
.
routes
.
draw
do
root
'static_pages#home'
get
'static_pages/home'
get
'static_pages/help'
get
'static_pages/about'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
...
...
test/controllers/static_pages_controller_test.rb
View file @
df59f375
...
...
@@ -4,11 +4,19 @@ class StaticPagesControllerTest < ActionController::TestCase
test
"should get home"
do
get
:home
assert_response
:success
assert_select
"title"
,
"Home | Ruby on Rails Tutorial Sample App"
end
test
"should get help"
do
get
:help
assert_response
:success
assert_select
"title"
,
"Help | Ruby on Rails Tutorial Sample App"
end
test
"should get about"
do
get
:about
assert_response
:success
assert_select
"title"
,
"About | Ruby on Rails Tutorial Sample App"
end
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