Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Illuna-Minecraft
illuna-minecraft.tk
Commits
cfa7fb3c
Commit
cfa7fb3c
authored
Aug 31, 2016
by
Milan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unneeded blogposts controller
parent
73d45b89
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
0 additions
and
94 deletions
+0
-94
app/assets/javascripts/blogposts.coffee
app/assets/javascripts/blogposts.coffee
+0
-3
app/assets/stylesheets/blogposts.scss
app/assets/stylesheets/blogposts.scss
+0
-3
app/controllers/blogposts_controller.rb
app/controllers/blogposts_controller.rb
+0
-33
app/helpers/blogposts_helper.rb
app/helpers/blogposts_helper.rb
+0
-2
app/views/blogposts/_form.html.erb
app/views/blogposts/_form.html.erb
+0
-18
app/views/blogposts/edit.html.erb
app/views/blogposts/edit.html.erb
+0
-3
app/views/blogposts/index.html.erb
app/views/blogposts/index.html.erb
+0
-12
app/views/blogposts/new.html.erb
app/views/blogposts/new.html.erb
+0
-4
app/views/blogposts/show.html.erb
app/views/blogposts/show.html.erb
+0
-9
test/controllers/blogposts_controller_test.rb
test/controllers/blogposts_controller_test.rb
+0
-7
No files found.
app/assets/javascripts/blogposts.coffee
deleted
100644 → 0
View file @
73d45b89
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
app/assets/stylesheets/blogposts.scss
deleted
100644 → 0
View file @
73d45b89
// Place all the styles related to the blogposts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
app/controllers/blogposts_controller.rb
deleted
100644 → 0
View file @
73d45b89
class
BlogpostsController
<
ApplicationController
def
index
@blogposts
=
Blogpost
.
all
end
def
show
@blogposts
=
Blogpost
.
find
(
params
[
:id
])
end
def
new
@blogposts
=
Blogpost
.
new
end
def
create
@blogposts
=
Blogpost
.
new
(
post_params
)
@blogposts
.
save
redirect_to
blogpost_path
(
@blogposts
)
end
def
edit
@blogposts
=
Blogpost
.
find
(
params
[
:id
])
end
def
update
@blogposts
=
Blogpost
.
find
(
params
[
:id
])
@blogposts
.
update
(
post_params
)
redirect_to
blogpost_path
(
@blogposts
)
flash
.
notice
=
"Article '
#{
@blogposts
.
title
}
' Updated!"
end
def
destroy
@blogposts
=
Blogpost
.
find
(
params
[
:id
])
@blogposts
.
destroy
redirect_to
@blogposts
end
def
post_params
params
.
require
(
:blogpost
).
permit
(
:title
,
:body
)
end
end
app/helpers/blogposts_helper.rb
deleted
100644 → 0
View file @
73d45b89
module
BlogpostsHelper
end
app/views/blogposts/_form.html.erb
deleted
100644 → 0
View file @
73d45b89
<%=
form_for
@blogposts
do
|
f
|
%>
<ul>
<%
@blogposts
.
errors
.
full_messages
.
each
do
|
error
|
%>
<li>
<%=
error
%>
</li>
<%
end
%>
</ul>
<p>
<%=
f
.
label
:title
%>
<br
/>
<%=
f
.
text_field
:title
%>
</p>
<p>
<%=
f
.
label
:body
%>
<br
/>
<%=
f
.
text_area
:body
%>
</p>
<p>
<%=
f
.
submit
%>
</p>
<%
end
%>
app/views/blogposts/edit.html.erb
deleted
100644 → 0
View file @
73d45b89
<%
content_for
:title
,
t
(
'blogposts.edit.title'
)
%>
<%=
render
partial:
'form'
%>
app/views/blogposts/index.html.erb
deleted
100644 → 0
View file @
73d45b89
<%
content_for
:title
,
t
(
'blogposts.index.title'
)
%>
<h1>
All Posts
</h1>
<ul
id=
"posts"
>
<%
@blogposts
.
each
do
|
blogpost
|
%>
<li>
<%=
link_to
blogpost
.
title
,
blogpost_path
(
blogpost
),
class:
'post_title'
%>
</li>
<%
end
%>
</ul>
<%=
link_to
"Create a New Post"
,
new_blogpost_path
,
class:
"new_post"
%>
app/views/blogposts/new.html.erb
deleted
100644 → 0
View file @
73d45b89
<%
content_for
:title
,
t
(
'blogposts.new.title'
)
%>
<h1>
New Post
</h1>
<%=
render
partial:
'form'
%>
app/views/blogposts/show.html.erb
deleted
100644 → 0
View file @
73d45b89
<%
content_for
:title
,
t
(
'blogposts.show.title'
)
%>
<div
class=
"content"
>
<h2>
<%=
@blogposts
.
title
%>
</h2>
<p>
<%=
markdown
(
@blogposts
.
body
).
html_safe
%>
</p>
<hr>
<%=
link_to
t
(
'blogposts.show.all_posts'
),
blogposts_path
,
class:
"btn btn-default"
%>
<%=
link_to
t
(
'blogposts.show.edit_post'
),
edit_blogpost_path
(
@blogposts
),
class:
"btn btn-info"
%>
<%=
link_to
t
(
'blogposts.show.delete_post'
),
blogpost_path
(
@blogposts
),
method: :delete
,
data:
{
confirm:
t
(
'blogposts.delete_post_confirm'
)},
class:
"btn btn-danger"
%>
</div>
test/controllers/blogposts_controller_test.rb
deleted
100644 → 0
View file @
73d45b89
require
'test_helper'
class
BlogpostsControllerTest
<
ActionDispatch
::
IntegrationTest
# test "the truth" do
# assert true
# 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