# Ruby equivalence for php include("file.php");

**URL:** <https://www.ruby-forum.com/t/ruby-equivalence-for-php-include-file-php/131292>\
**Category:** Ruby\
**Created:** [March 7, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/ruby-equivalence-for-php-include-file-php/131292 "2008-03-07T18:23:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miquel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@Miquel\_O](https://www.ruby-forum.com/u/Miquel_O)\
**Post date:** [March 7, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/ruby-equivalence-for-php-include-file-php/131292/1 "2008-03-07T18:23:55Z")

</div>

Hi there

I’m doing some RoR exercices to begin a website and I want to include a  
file which contains the header template. I have coded using php  
before and I know it’s done using include(“file.php”) and I don’t know  
how to do it.

How do you include a html template into another one (I haven’t found  
anything googling)?

Thanks in advance

Regards

–

Miquel (a.k.a. Ktalà a.k.a. Ton)  
Linux User #286784  
GPG Key : 4D91EF7F  
Debian GNU/Linux (Linux wolverine 2.6.22.5)

Welcome to the jungle, we got fun and games  
Guns n’ Roses

---

<div class="post-metadata">

**Author:** ![Miquel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@Miquel\_O](https://www.ruby-forum.com/u/Miquel_O)\
**Post date:** [March 7, 2008, 6:28pm UTC](https://www.ruby-forum.com/t/ruby-equivalence-for-php-include-file-php/131292/2 "2008-03-07T18:28:37Z")

</div>

Miquel O. wrote:

> I’m doing some RoR exercices to begin a website and I want to include a  
> file which contains the header template. I have coded using php  
> before and I know it’s done using include(“file.php”) and I don’t know  
> how to do it.

This is the Ruby mailing list. The Ruby on Rails mailing list is what  
you want: [http://groups.google.com/group/rubyonrails-talk](http://groups.google.com/group/rubyonrails-talk)

Any good (or even mediocre) RoR tutorial will tell you how to do this.  
Hint: ‘render :partial’.

---

<div class="post-metadata">

**Author:** ![Miquel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@Miquel\_O](https://www.ruby-forum.com/u/Miquel_O)\
**Post date:** [March 7, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/ruby-equivalence-for-php-include-file-php/131292/3 "2008-03-07T18:57:35Z")

</div>

On Sat, 8 Mar 2008 02:27:37 +0900  
Avdi G. wrote:

> This is the Ruby mailing list. The Ruby on Rails mailing list is what  
> you want: [http://groups.google.com/group/rubyonrails-talk](http://groups.google.com/group/rubyonrails-talk)
> 
> Any good (or even mediocre) RoR tutorial will tell you how to do this.  
> Hint: ‘render :partial’.

Thanks for your hint and let me abuse of your kindness and knowledge  
asking which are the differences between ‘render :partial’ and ‘render:  
file’

Thanks again 😃

Regards

–

Miquel (a.k.a. Ktalà a.k.a. Ton)  
Linux User #286784  
GPG Key : 4D91EF7F  
Debian GNU/Linux (Linux wolverine 2.6.22.5)

Welcome to the jungle, we got fun and games  
Guns n’ Roses

---

<div class="post-metadata">

**Author:** ![Miquel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@Miquel\_O](https://www.ruby-forum.com/u/Miquel_O)\
**Post date:** [March 7, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/ruby-equivalence-for-php-include-file-php/131292/4 "2008-03-07T19:11:08Z")

</div>

> Thanks for your hint and let me abuse of your kindness and knowledge  
> asking which are the differences between ‘render :partial’ and ‘render:  
> file’

> **[ActionController::Base](https://api.rubyonrails.org/classes/ActionController/Base.html#M000452)**
>
> Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed on request and then either it renders a template or redirects to another action.

---

<div class="post-metadata">

**Author:** ![Miquel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@Miquel\_O](https://www.ruby-forum.com/u/Miquel_O)\
**Post date:** [March 7, 2008, 7:34pm UTC](https://www.ruby-forum.com/t/ruby-equivalence-for-php-include-file-php/131292/5 "2008-03-07T19:34:51Z")

</div>

On Sat, 8 Mar 2008 03:10:01 +0900  
Avdi G. wrote:

> > Thanks for your hint and let me abuse of your kindness and knowledge  
> > asking which are the differences between ‘render :partial’ and ‘render:  
> > file’
> 
> [ActionController::Base](http://api.rubyonrails.org/classes/ActionController/Base.html#M000452)
> 
> –  
> Avdi

Thanks a lot Avdi, I was reading this page when I received your answer.

Regards

–

Miquel (a.k.a. Ktalà a.k.a. Ton)  
Linux User #286784  
GPG Key : 4D91EF7F  
Debian GNU/Linux (Linux wolverine 2.6.22.5)

Welcome to the jungle, we got fun and games  
Guns n’ Roses
