Difference between "require VS include"

64 views
Skip to first unread message

Palani Kumar

unread,
Sep 15, 2008, 9:58:59 AM9/15/08
to rubyonra...@googlegroups.com
Hi,
Can any one please tell me the difference between require statement
and include statement in Rails application...please
--
Posted via http://www.ruby-forum.com/.

Palani Kumar

unread,
Sep 15, 2008, 10:17:35 AM9/15/08
to rubyonra...@googlegroups.com
Frederick Cheung wrote:

> On 15 Sep 2008, at 14:58, Palani Kumar wrote:
>
>>
>> Hi,
>> Can any one please tell me the difference between require statement
>> and include statement in Rails application...please
>
> They're basically completely different. require means 'go and load
> this file'. include means 'include this module in the current module/
> class/whatever'. For example in the context of a class this will add
> the constants and methods from the module to the class in question.
>
> Fred


Thank you so much Fred Thanks

Reply all
Reply to author
Forward
0 new messages