title: uninitialized constant Reservations
body: <p>hi im having a bit trouble in my application im new in ROR development
  i made a static page where my function rooms of my reservation
  application are showed and can be add in in the
  reservation_function_room(line item of reservation functionroom) it
  raises uninitialized constant Reservations when ever i route to <code>&lt;%= link_to "add functionrooms", reservation_pages_functionroom_path(@reservation) %&gt;</code> cant figure out whats wrong
  very thanks in advance thanks</p>
  
  <p>page-static pages</p>
  
  <pre><code>class PagesController &lt; ApplicationController
  
    def functionroom
      @reservation = Reservation.find(params[:reservation_id])
      @function_room = FunctionRoom.all
    end
  end
  </code></pre>
  
  <hr>
  
  <p>functionroom.html.erb</p>
  
  <pre><code>&lt;% if notice %&gt;
  &lt;p id = "notice"&gt;&lt;%= notice%&gt;&lt;/p&gt;
  &lt;%end%&gt;
  
    &lt;h1&gt;functionRooms&lt;/h1&gt;
    &lt;%@function_room.each do |functionroom|%&gt;
    &lt;h3&gt;&lt;%= functionroom.name%&gt;&lt;/h3&gt;
    &lt;p&gt;&lt;%= number_to_currency(functionroom.price)%&gt;&lt;/p&gt;
    &lt;%= button_to 'add function room',
  reservation_reservation_function_room_path(:function_room_id =&gt;
  functionroom), :method =&gt; :post,:remote =&gt; true%&gt;
    &lt;%end%&gt;
  </code></pre>
  
  <hr>
  
  <p>reservation_contoller.rb</p>
  
  <pre><code>def index
      @reservations = Reservation.all
    end
  
    def show
      @reservation = Reservation.includes(:reservation_function_rooms =&gt;
  :function_room,:reservation_package =&gt; :package).find(params[:id])
    end
  </code></pre>
  
  <hr>
  
  <pre><code>class ReservationFunctionRoomsController &lt; InheritedResources::Base
   def show
     @reservation_function_room =
  ReservationFunctionRoom.find(params[:id])
   end
  
  
  def new
    @reservation_function_room = ReservationFunctionRoom.new
  end
  
  def create
    @reservation = Reservation.find(params[:reservation_id])
    function_room = FunctionRoom.find(params[:function_room_id])
    @reservation_function_room =
  @reservation.add_function_room(function_room.id)
  
    if @reservation_function_room.save
      redirect_to @reservation, :notice =&gt; "function room successfuly
  added"
    end
  end
  end
  </code></pre>
  
  <hr>
  
  <p>routes</p>
  
  <pre><code>  get "pages/menu"
  
    resources :reservation_function_rooms
  
  
  
  
    resources :services
  
    resources :reservations do
       get "pages/functionroom"
    end
  
    resources :reservation_packages
  
    resources :package_line_items
  
  
    resources :packages do
      resources :package_crews
    end
  
    resources :function_rooms
  </code></pre>
  
  <hr>
  
  <p>reservation.rb</p>
  
  <pre><code>class Reservation &lt; ActiveRecord::Base
    has_one :reservation_package
    belongs_to :service
    has_many :reservation_function_rooms
    has_many :package_line_items
    has_many :menus , :through =&gt; :package_line_items, :uniq =&gt; true
    has_many :function_rooms, :through =&gt;:reservation_function_rooms
  
      def add_function_room(function_room_id)
       current_function_room =
  reservation_function_rooms.find_by_function_room_id(function_room_id)
       if current_function_room
         redirect_to @reservation, :notice =&gt; "function room already
  added"
       else
       current_function_room =
  reservation_function_rooms.build(:function_room =&gt; function_room_id)
       current_function_room.price =
  current_function_room.function_room.price
       end
       current_function_room
      end
  
  end
  </code></pre>
  
  <p>reservation/show.html.erb</p>
  
  <pre><code>&lt;p id="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Name:&lt;/b&gt;
    &lt;%= @reservation.name %&gt;
  &lt;/p&gt;
  
  &lt;%= display_package @reservation%&gt;
  &lt;p&gt;
    &lt;b&gt;Address:&lt;/b&gt;
    &lt;%= @reservation.address %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Contact:&lt;/b&gt;
    &lt;%= @reservation.contact %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Date:&lt;/b&gt;
    &lt;%= @reservation.date %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Timestart:&lt;/b&gt;
    &lt;%= @reservation.timeStart %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Timeend:&lt;/b&gt;
    &lt;%= @reservation.timeEnd %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;b&gt;Numguest:&lt;/b&gt;
    &lt;%= @reservation.numGuest %&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
      &lt;%= link_to "add functionrooms", reservation_pages_functionroom_path(@reservation) %&gt;
  &lt;/p&gt;
  
  
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Function room&lt;/th&gt;
          &lt;th&gt;Price&lt;/th&gt;
      &lt;/tr&gt;
      &lt;% @reservation.reservation_function_rooms.each do |room|%&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;%= room.function_room.name%&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= room.function_room.price%&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  
  
  &lt;%end%&gt;
  
  
  &lt;/table&gt;
  
  
  
  
  
  &lt;%= link_to 'Edit', edit_reservation_path(@reservation) %&gt; |
  &lt;%= link_to 'Back', reservations_path %&gt;
  </code></pre>
  
  <p>if anything is needed feel free to ask thanks in advance :)</p>