In the issue.rb I have mentioned:
has_many :relationships, :dependent => :d
By using accepts_nested_attributes, you have created a setter method relationship_attributes=.
There are a couple of things I noticed that need to change.
You don't need to set
@relationship = @issue.relationships.build
Your form should be the following (you have f.fields_for :relationship)
= form_for @issue do |f|
# your issue fields here
= f.fields_for :relationships do |r|
# your relationship fields here
The beauty here is that you won't have to set any ids or anything.