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
Đường Sỹ Hoàng
sample_app
Commits
f2e2d3dc
Commit
f2e2d3dc
authored
Nov 21, 2019
by
Đường Sỹ Hoàng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed coding styles
parent
2ded87ff
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
app/controllers/application_controller.rb
+0
-0
app/helpers/microposts_helper.rb
+0
-2
app/models/micropost.rb
+4
-1
app/models/user.rb
+0
-1
app/views/static_pages/home.html.erb
+2
-2
No files found.
app/controllers/application_controller.rb
View file @
f2e2d3dc
app/helpers/microposts_helper.rb
deleted
100644 → 0
View file @
2ded87ff
module
MicropostsHelper
end
app/models/micropost.rb
View file @
f2e2d3dc
class
Micropost
<
ApplicationRecord
class
Micropost
<
ApplicationRecord
belongs_to
:user
default_scope
->
{
order
(
created_at: :desc
)
}
default_scope
->
{
order
(
created_at: :desc
)
}
mount_uploader
:picture
,
PictureUploader
mount_uploader
:picture
,
PictureUploader
belongs_to
:user
validates
:user_id
,
presence:
true
validates
:user_id
,
presence:
true
validates
:content
,
presence:
true
,
length:
{
maximum:
140
}
validates
:content
,
presence:
true
,
length:
{
maximum:
140
}
validate
:picture_size
validate
:picture_size
...
...
app/models/user.rb
View file @
f2e2d3dc
...
@@ -3,7 +3,6 @@ class User < ApplicationRecord
...
@@ -3,7 +3,6 @@ class User < ApplicationRecord
attr_accessor
:remember_token
,
:activation_token
,
:reset_token
attr_accessor
:remember_token
,
:activation_token
,
:reset_token
has_many
:microposts
has_many
:microposts
,
dependent: :destroy
has_many
:microposts
,
dependent: :destroy
validates
:email
,
presence:
true
,
length:
{
maximum:
255
},
format:
{
with:
VALID_EMAIL_REGEX
},
uniqueness:
{
case_sensitive:
false
}
validates
:email
,
presence:
true
,
length:
{
maximum:
255
},
format:
{
with:
VALID_EMAIL_REGEX
},
uniqueness:
{
case_sensitive:
false
}
...
...
app/views/static_pages/home.html.erb
View file @
f2e2d3dc
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
<%=
render
"shared/feed"
%>
<%=
render
"shared/feed"
%>
</div>
</div>
</div>
</div>
<%
else
%>
<%
else
%>
<div
class=
"center jumbotron"
>
<div
class=
"center jumbotron"
>
<h1>
Welcome to the Sample App
</h1>
<h1>
Welcome to the Sample App
</h1>
<h2>
<h2>
...
...
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