Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
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
VeNtura
rendezvous
Commits
b0ab55fb
Commit
b0ab55fb
authored
May 07, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commentのcallbackを追加
parent
9f411a7e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
app/models/comment.rb
+9
-0
app/views/flow/show.html.slim
+3
-1
No files found.
app/models/comment.rb
View file @
b0ab55fb
...
...
@@ -17,4 +17,13 @@ class Comment < ActiveRecord::Base
validates
:author_id
,
presence:
true
validates
:post_id
,
presence:
true
validates
:body
,
presence:
true
### Callback ###
after_save
:notify_author
private
def
notify_author
post
.
author
.
push_notification
(
post
.
decorate
.
show_path
,
"
#{
author
.
name
}
さんがあなたの投稿にコメントしました"
)
end
end
app/views/flow/show.html.slim
View file @
b0ab55fb
...
...
@@ -23,6 +23,8 @@
h2
.panel-title
最近投稿されたタグ
.panel-body.list-group
-
Tag
.
recent
(
10
).
each_with_index
do
|
tag
,
i
|
a
.list-group-item
data-tag-id
=
tag
.id
href
=
search_path
(
q:
"#
#{
tag
.
name
}
"
)
=
"
#{
tag
.
name
}
(
#{
tag
.
posts_count
}
)"
a
.list-group-item
data-tag-id
=
tag
.id
href
=
search_path
(
q:
"#
#{
tag
.
name
}
"
)
=
tag
.
name
span
.badge
=
tag
.
posts_count
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