Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
blog
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mis-21-2018-intersession
rails
blog
Commits
8c65cdc8
Commit
8c65cdc8
authored
Jul 02, 2018
by
John Noel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimization #1 - Partials
parent
83eeba1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
_form.html.erb
app/views/posts/_form.html.erb
+6
-0
edit.html.erb
app/views/posts/edit.html.erb
+1
-6
new.html.erb
app/views/posts/new.html.erb
+1
-6
No files found.
app/views/posts/_form.html.erb
0 → 100644
View file @
8c65cdc8
<%=
simple_form_for
post
do
|
f
|
%>
<%=
f
.
input
:title
%>
<%=
f
.
input
:content
%>
<%=
f
.
button
:submit
,
"Post"
,
class:
"btn btn-primary"
%>
<%=
link_to
"Back"
,
posts_path
,
class:
"btn btn-default"
%>
<%
end
%>
\ No newline at end of file
app/views/posts/edit.html.erb
View file @
8c65cdc8
<h1>
Edit Post
</h1>
<h1>
Edit Post
</h1>
<%=
simple_form_for
@post
do
|
f
|
%>
<%=
render
partial:
'form'
,
locals:
{
post:
@post
}
%>
<%=
f
.
input
:title
%>
\ No newline at end of file
<%=
f
.
input
:content
%>
<%=
f
.
button
:submit
,
"Post"
,
class:
"btn btn-primary"
%>
<%=
link_to
"Back"
,
posts_path
,
class:
"btn btn-default"
%>
<%
end
%>
\ No newline at end of file
app/views/posts/new.html.erb
View file @
8c65cdc8
<h1>
New Post
</h1>
<h1>
New Post
</h1>
<%=
simple_form_for
@post
do
|
f
|
%>
<%=
render
partial:
'form'
,
locals:
{
post:
@post
}
%>
<%=
f
.
input
:title
%>
\ No newline at end of file
<%=
f
.
input
:content
%>
<%=
f
.
button
:submit
,
"Post"
,
class:
"btn btn-primary"
%>
<%=
link_to
"Back"
,
posts_path
,
class:
"btn btn-default"
%>
<%
end
%>
\ No newline at end of file
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