Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/comments/_form.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
= form.check_box :published
.field
= form.label :dependency_id
= form.text_field :dependency_id
= form.select :dependency_id, Dependency.all.map { |d| [d.name, d.id]}
.actions
= form.submit
3 changes: 2 additions & 1 deletion app/views/comments/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
%tr
%td= comment.body
%td= comment.published
%td= comment.dependency
%td= comment.dependency.name
%td= link_to "Show", comment
%td= link_to "Edit", edit_comment_path(comment)
%td= link_to "Destroy", comment, method: :delete, data: { confirm: "Are you sure?" }
%br
= link_to "New Comment", new_comment_path
= link_to "Back to dependencies", dependencies_path
2 changes: 1 addition & 1 deletion app/views/comments/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
= @comment.published
%p
%strong Dependency:
= @comment.dependency
= @comment.dependency.name
= link_to "Edit", edit_comment_path(@comment)
|
= link_to "Back", comments_path
3 changes: 3 additions & 0 deletions app/views/dependencies/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
- @dependencies.each do |dependency|
%tr
%td= dependency.name
%td= "#{dependency.comments.count} #{Comment.model_name.human(count: dependency.comments.count)}"
%td= link_to "Show", dependency
%td= link_to "Edit", edit_dependency_path(dependency)
%td= link_to "Destroy", dependency, method: :delete, data: { confirm: "Are you sure?" }
%br
= link_to "New Dependency", new_dependency_path
= link_to "New Comment", new_comment_path
= link_to "See Comments", comments_path
5 changes: 5 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
en:
activerecord:
models:
comment:
one: comment
other: comments