personal_blog 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9f9feaa7adef8c3c0d7092923f9ae8b88882164
4
- data.tar.gz: de91940d7d257bc0a85f05cae8a2b4dccf2e8e2c
3
+ metadata.gz: 28288b634a8ec43bc814314ee56c734c78302e3f
4
+ data.tar.gz: 02773f8e858892e2d0141de4c70e2de3cc9a6998
5
5
  SHA512:
6
- metadata.gz: 296a7539177bb4d869dda93d780f1f631d6910a24f63cee23b31b8bc014f3f2600451e0f4bada8a33d8782b2c72a0019a286f46e51616f3136c32f9173640d3b
7
- data.tar.gz: 370be74a55a8b539dd6b7050499bc3cf677a9ac4b73839afef85a483e7ce51543f94c58c24a88578945a38c0df0185d07888aa15bd629ae4828bf3da770fcd47
6
+ metadata.gz: 02a82ba0bfc432dbdfb22d033ebd75ac0e25b430a0dcd8552e46b476b863fa309d8af0e4a5b3bb3ae9440b455d200a4c31f743a4c36fd46d1d675e159de971d6
7
+ data.tar.gz: c2b1875225e4f5294b854e6e4cb7f372e5228e648eb99abd687bbb2b8326e4ffc9a34329c4222da0dfef2911900905fcbd28c00c7d528b97aaeaccafa4eef2de
@@ -14,6 +14,13 @@ module PersonalBlog
14
14
  end
15
15
  end
16
16
 
17
+ def destroy
18
+ @post = Post.find(params[:post_id])
19
+ @comment = @post.comments.find(params[:id])
20
+ @comment.destroy
21
+ redirect_to post_path(@post), notice: "Comment was successfully destroyed."
22
+ end
23
+
17
24
  private
18
25
  def comment_params
19
26
  params.require(:comment).permit(:text, :author)
@@ -3,6 +3,6 @@
3
3
  <span class="comment-date"><%= comment.created_at.strftime('%B %e, %Y')%></span> <br>
4
4
  <%= comment.text %>
5
5
  <% if admin? %>
6
- <%= link_to 'Delete', @post, method: :delete, data: { confirm: 'Are you sure?' }, class: 'comment-delete' %>
6
+ <%= link_to 'Delete', post_comment_path(@post, comment), method: :delete, data: { confirm: 'Are you sure?' }, class: 'comment-delete' %>
7
7
  <% end %>
8
8
  </div>
@@ -1,3 +1,3 @@
1
1
  module PersonalBlog
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: personal_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nakul Pathak