I keep getting an undefined method for a class <p>I've been searching and searching but I cannot find anything to help me with this. I am building an app that allows you to schedule a meeting in a room. The error I'm receiving is </p> <pre><code>undefined method 'room_id' for #&lt;Room:0x007fa25cc51128&gt; </code></pre> <p>Here is where the error is occuring in my <code>application.html.erb</code>:</p> <pre><code>&lt;li&gt;&lt;%= link_to "Schedule a Meeting", new_room_meeting_path(@user, @meeting, @room.room_id)%&gt;&lt;/li&gt; </code></pre> <p>Here is my meetings controller:</p> <pre><code>class MeetingsController &lt; ApplicationController before_action :authenticate_user! def new @meeting = Meeting.new @rooms = Room.all @room = Room.find(params[:room_id]) end def index @meetings = Meeting.all end def show @meeting = Meeting.find(params[:id]) @comments = @meeting.comments @room = Room.find(params[:id]) end def create @user = User.find(params[:user_id]) @meeting = @user.meetings.create(meeting_params) NotificationMailer.meeting_scheduled(@meeting).deliver_now if @meeting.save redirect_to root_path, flash: { notice: "Congratulations!!! Your meeting has been scheduled successfully!!!"} else render :new end end private def meeting_params params.require(:meeting).permit(:name, :start_time, :end_time, :user_id, :room_id) end end </code></pre> <p>Here is my Meeting model:</p> <pre><code>require 'twilio-ruby' class Meeting &lt; ActiveRecord::Base belongs_to :user belongs_to :room has_many :comments validates_presence_of :user_id, :room_id, :name def meeting_author_email user.try(:email) end def self.send_reminder_text_message(body, phone) @account_sid = ENV['twilio_account_sid'] @auth_token = ENV['twilio_auth_token'] @from_phone_number = ENV['twilio_phone_number'] @twilio_client = Twilio::REST::Client.new(@account_sid, @auth_token) @twilio_client.account.messages.create( to: phone, from: @from_phone_number, body: body ) end def start_timestamp (start_time - 6.hours).strftime('%b %e, %l:%M %p') end def end_timestamp (end_time - 6.hours).strftime('%b %e, %l:%M %p') end end </code></pre> <p>The correct URI is: <code>/rooms/:room_id/meetings/new(.:format)</code></p> <p>I don't know what the problem is and it is really frustrating me. Any help would be greatly appreciated. I've searched over and over and have been unable to resolve this.</p> <p>Thanks.</p>