# How to show data in included class?

**URL:** <https://www.ruby-forum.com/t/how-to-show-data-in-included-class/118529>\
**Category:** Rails\
**Created:** [October 28, 2007, 7:37am UTC](https://www.ruby-forum.com/t/how-to-show-data-in-included-class/118529 "2007-10-28T07:37:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![malioboro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@malioboro](https://www.ruby-forum.com/u/malioboro)\
**Post date:** [October 28, 2007, 7:37am UTC](https://www.ruby-forum.com/t/how-to-show-data-in-included-class/118529/1 "2007-10-28T07:37:33Z")

</div>

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.
