{"action":"created","issue":{"url":"https://api.github.com/repos/luciuschoi/vagrant-test/issues/2","repository_url":"https://api.github.com/repos/luciuschoi/vagrant-test","labels_url":"https://api.github.com/repos/luciuschoi/vagrant-test/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/luciuschoi/vagrant-test/issues/2/comments","events_url":"https://api.github.com/repos/luciuschoi/vagrant-test/issues/2/events","html_url":"https://github.com/luciuschoi/vagrant-test/issues/2","id":335130005,"node_id":"MDU6SXNzdWUzMzUxMzAwMDU=","number":2,"title":"Can comments also be rendered for other models?","user":{"login":"Klashe","id":26233134,"node_id":"MDQ6VXNlcjI2MjMzMTM0","avatar_url":"https://avatars1.githubusercontent.com/u/26233134?v=4","gravatar_id":"","url":"https://api.github.com/users/Klashe","html_url":"https://github.com/Klashe","followers_url":"https://api.github.com/users/Klashe/followers","following_url":"https://api.github.com/users/Klashe/following{/other_user}","gists_url":"https://api.github.com/users/Klashe/gists{/gist_id}","starred_url":"https://api.github.com/users/Klashe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Klashe/subscriptions","organizations_url":"https://api.github.com/users/Klashe/orgs","repos_url":"https://api.github.com/users/Klashe/repos","events_url":"https://api.github.com/users/Klashe/events{/privacy}","received_events_url":"https://api.github.com/users/Klashe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-23T20:46:35Z","updated_at":"2018-07-03T10:08:24Z","closed_at":null,"author_association":"NONE","body":"I think since this is polymorphic i should be able to use it with another model. It worked well with my story model but when i implemented it to an episode model which belongs to story i was faced with an error \"undefined method `episode_comments_path' for #<#<Class:0xb3ea688>:0x10f44b70>\" pointing to \"<%= form_for [comment.commentable, comment], remote: true do | f | %>\""},"comment":{"url":"https://api.github.com/repos/luciuschoi/vagrant-test/issues/comments/402090721","html_url":"https://github.com/luciuschoi/vagrant-test/issues/2#issuecomment-402090721","issue_url":"https://api.github.com/repos/luciuschoi/vagrant-test/issues/2","id":402090721,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjA5MDcyMQ==","user":{"login":"luciuschoi","id":7693013,"node_id":"MDQ6VXNlcjc2OTMwMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/7693013?v=4","gravatar_id":"","url":"https://api.github.com/users/luciuschoi","html_url":"https://github.com/luciuschoi","followers_url":"https://api.github.com/users/luciuschoi/followers","following_url":"https://api.github.com/users/luciuschoi/following{/other_user}","gists_url":"https://api.github.com/users/luciuschoi/gists{/gist_id}","starred_url":"https://api.github.com/users/luciuschoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luciuschoi/subscriptions","organizations_url":"https://api.github.com/users/luciuschoi/orgs","repos_url":"https://api.github.com/users/luciuschoi/repos","events_url":"https://api.github.com/users/luciuschoi/events{/privacy}","received_events_url":"https://api.github.com/users/luciuschoi/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T10:08:24Z","updated_at":"2018-07-03T10:08:24Z","author_association":"OWNER","body":"Yeap. I found out the error.\r\nYou missed to add `simple_form` gem in Gemfile and bundle install.\r\nAdditionally, after that, you should do the following command:\r\n\r\n```shell\r\n$ rails g simple_form:install --bootstrap\r\n```\r\n\r\nFinally, you modified the `comments/_form.html.erb` file as follows:\r\n\r\n```erb\r\n<div class=\"comment-form\">\r\n  <%= simple_form_for [comment.commentable, comment], remote: true do | f | %>\r\n    <%= f.hidden_field :parent_id %>\r\n    <div class=\"mb-3\">\r\n      <p><%= f.input :content, label: false, class: \"form-control\", placeholder: (f.object.parent_id.nil? ? 'Share your idea.' : 'Leave your reply.'), wrapper_html: { class: 'mb-1' }, input_html: { rows: 5, data:{ 'comment-id': (comment.persisted? ? comment.id : 'new') }} %></p>\r\n    </div>\r\n    <span id=\"comment_<%= comment.persisted? ? comment.id : 'new' %>_chars_counter\" class=\"comment_chars_counter\">Remaining : 255</span>\r\n    <div class='float-right'>\r\n      <%= f.submit \"Submit Comment\", class: \"btn btn-sm btn-success float-xs-right\", data: { disable_with: \"<i class='fa fa-spinner fa-spin'></i> Submiting Comment...\" } %>\r\n      <%= link_to \"Cancel\", \"#\", 'data-reply': comment.parent_id.present?, class: 'cancel-comment-link btn btn-warning btn-sm float-xs-right ml-1' if comment.persisted? or comment.parent %>\r\n    </div>  \r\n    <div class=\"clearfix\"></div>\r\n  <% end %>\r\n</div>\r\n```\r\n\r\nThat't it.\r\nSorry to be late."}}
{"actor":{"display_login":"luciuschoi"}}