{"action":"created","issue":{"url":"https://api.github.com/repos/nathanvda/cocoon/issues/107","labels_url":"https://api.github.com/repos/nathanvda/cocoon/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/nathanvda/cocoon/issues/107/comments","events_url":"https://api.github.com/repos/nathanvda/cocoon/issues/107/events","html_url":"https://github.com/nathanvda/cocoon/issues/107","id":8812730,"number":107,"title":"undefined method `new_record?' for nil:NilClass","user":{"login":"davelab","id":719197,"avatar_url":"https://avatars.githubusercontent.com/u/719197?v=3","gravatar_id":"","url":"https://api.github.com/users/davelab","html_url":"https://github.com/davelab","followers_url":"https://api.github.com/users/davelab/followers","following_url":"https://api.github.com/users/davelab/following{/other_user}","gists_url":"https://api.github.com/users/davelab/gists{/gist_id}","starred_url":"https://api.github.com/users/davelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davelab/subscriptions","organizations_url":"https://api.github.com/users/davelab/orgs","repos_url":"https://api.github.com/users/davelab/repos","events_url":"https://api.github.com/users/davelab/events{/privacy}","received_events_url":"https://api.github.com/users/davelab/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2012-11-29T14:45:24Z","updated_at":"2015-07-02T07:41:08Z","closed_at":"2012-11-30T10:56:04Z","body":"Hi i'm building a relations Company :has_many Notes.\n\ni want to be able to add some new notes to a just created company in the Comany#show resource. so in the company scaffold's show.html.erb\n\ni have follwed step by step the demostration and the git mardown, but your examples shows only the method to add nested attribute into _form.html.erb partial. I don't know if there is some particular things to do differently, but when i try to run the Company#show action it retrieves this erro:\n\nundefined method `new_record?' for nil:NilClass\n\nthis is my code\n\nshow.html.erb:\n```ruby\n...\n<%= simple_form_for :notes, :html => { :class => 'form-horizontal' } do |note| %>\n      <%= render 'note_fields', :f => note %>\n    <% end %>\n    <%= link_to_add_association 'Aggiungi Nota', f, :notes, :render_options => {:wrapper => 'inline' } %>\n...\n```\n\n\n_note_fields.html.erb:\n```ruby\n...\n<div class=\"nested-fields\">\n\t<%= f.input :body %>\n\t<%= link_to_remove_association \"Elimina Nota\", f %>\n</div>\n....\n```\n\nCompany.rb:\n```ruby\n...\nhas_many :notes\naccepts_nested_attributes_for :notes, :reject_if => :all_blank, :allow_destroy => true\n...\n```\n\nNote.rb\n```ruby\nclass Note < ActiveRecord::Base\n  attr_accessible :body, :company_id\n  belongs_to :company\nend\n```\n\n\nthanks!\nDave"},"comment":{"url":"https://api.github.com/repos/nathanvda/cocoon/issues/comments/117946218","html_url":"https://github.com/nathanvda/cocoon/issues/107#issuecomment-117946218","issue_url":"https://api.github.com/repos/nathanvda/cocoon/issues/107","id":117946218,"user":{"login":"justinj656","id":6373811,"avatar_url":"https://avatars.githubusercontent.com/u/6373811?v=3","gravatar_id":"","url":"https://api.github.com/users/justinj656","html_url":"https://github.com/justinj656","followers_url":"https://api.github.com/users/justinj656/followers","following_url":"https://api.github.com/users/justinj656/following{/other_user}","gists_url":"https://api.github.com/users/justinj656/gists{/gist_id}","starred_url":"https://api.github.com/users/justinj656/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinj656/subscriptions","organizations_url":"https://api.github.com/users/justinj656/orgs","repos_url":"https://api.github.com/users/justinj656/repos","events_url":"https://api.github.com/users/justinj656/events{/privacy}","received_events_url":"https://api.github.com/users/justinj656/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T07:41:08Z","updated_at":"2015-07-02T07:41:08Z","body":"I actually got into the same problem, use `f.simple_form_for` instead of 'simple_form_for'"}}