title: undefined method 'name' in nil:NilClass
body: <p>So we are currently working on a website for an important customer, and we have run into a roadblock that has prevented further progression. We were working on relationships between database tables and one of the tables is not recognizing the above named method. Here is the code:</p>
  
  <p>organizers_controller.rb:</p>
  
  <pre><code>  # GET /organizers.json
  def index
    @organizers = Organizer.all
  end
  
  # GET /organizers/1
  # GET /organizers/1.json
  def show
  end
  
  # GET /organizers/new
  def new
    @organizer = Organizer.new
  end
  
  # GET /organizers/1/edit
    def edit
  end
  
  # POST /organizers
  # POST /organizers.json
  def create
    @organizer = Organizer.new(organizer_params)
  
  respond_to do |format|
    if @organizer.save
      format.html { redirect_to @organizer, notice: 'Organizer was successfully created.' }
      format.json { render :show, status: :created, location: @organizer }
    else
      format.html { render :new }
      format.json { render json: @organizer.errors, status: :unprocessable_entity }
    end
  end
  end
  
  # PATCH/PUT /organizers/1
  # PATCH/PUT /organizers/1.json
  def update
    respond_to do |format|
      if @organizer.update(organizer_params)
        format.html { redirect_to @organizer, notice: 'Organizer was successfully updated.' }
      format.json { render :show, status: :ok, location: @organizer }
    else
      format.html { render :edit }
      format.json { render json: @organizer.errors, status: :unprocessable_entity }
    end
  end
  end
  
  # DELETE /organizers/1
  # DELETE /organizers/1.json
  def destroy
    @organizer.destroy
    respond_to do |format|
      format.html { redirect_to organizers_url, notice: 'Organizer was successfully destroyed.' }
    format.json { head :no_content }
  end
  end
  
  private
    # Use callbacks to share common setup or constraints between actions.
    def set_organizer
      @organizer = Organizer.find(params[:id])
    end
  
  # Never trust parameters from the scary internet, only allow the white list through.
  def organizer_params
    params.require(:organizer).permit(:name)
  end
  end
  </code></pre>
  
  <p>show.html.erb:</p>
  
  <pre><code>&lt;p id="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;
  
  &lt;p&gt;
    &lt;strong&gt;Title:&lt;/strong&gt;
    &lt;%= @event.title %&gt;
    &lt;strong&gt;Organization&lt;/strong&gt;
    &lt;%= @organizer.name %&gt;
  &lt;/p&gt;
  
  &lt;%= link_to 'Edit', edit_event_path(@event) %&gt; |
  &lt;%= link_to 'Back', events_path %&gt;
  </code></pre>
  
  <p>Relevant error:</p>
  
  <pre><code>undefined method `name' for nil:NilClass
  </code></pre>
  
  <p>Excuse the spacing issues, the code didn't translate well over to the codeblock</p>