title: How do I access data from a model the present model belongs to?
body: <p>I have two models Issue and Split.</p>
  
  <p>Issues have many Splits, a Split belongs to an Issue. Here is the code for the two models:</p>
  
  <pre><code>class Issue &lt; ActiveRecord::Base
  
      belongs_to :publication
      has_many :splits
      has_many :issue_split_geographies
      belongs_to :medium
  
      validates :name, :start_date, :status, presence: true
  end
  
  class Split &lt; ActiveRecord::Base
      belongs_to :issue
      has_and_belongs_to_many :geographies 
      has_and_belongs_to_many :media 
  end
  </code></pre>
  
  <p>I know how to access split information from an issue in my Issue views by doing @issue.split.name if I want to get a split name in my issue view.</p>
  
  <p>I'm having problems figuring out how to go the other way. How can I show Issue information in a Split view?</p>
  
  <p>@split.issue.target gives me undefined method `issue' for nil:NilClass</p>
  
  <p>split.issue.target gives me undefined local variable or method `split' for</p>
  
  <p>issue.target gives me "undefined local variable or method `issue' for"</p>
  
  <p>I'm trying to show the target value for the issue on the splits index page so I can determine how many more splits to add to reach my target.</p>
  
  <p>It seems like I'm missing something obvious. But, I'm a bit of a noob.</p>
  
  <p>Thanks</p>