Dear All.
Sorry I am noob here, I want to ask how to show data in included class.
this is my detail :
class Kamar < ActiveRecord::Base
belongs_to :hotel, :foreign_key => ‘id_hotel’
class Hotel < ActiveRecord::Base
has_many :kamars, :foreign_key => ‘id_hotel’
class HotelController < ApplicationController
…
def list
@hotels = Hotel.find (:all, :include=> :kamars ,
:conditions => [“kamars.id_tipe_kamar = ?”,
‘6’])
…
I want to show all data in kamars that corresponding with @hotels and
the condition. Please Help me.
Thanks.