# File include error

**URL:** <https://www.ruby-forum.com/t/file-include-error/174003>\
**Category:** Rails\
**Created:** [August 19, 2009, 8:01am UTC](https://www.ruby-forum.com/t/file-include-error/174003 "2009-08-19T08:01:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 19, 2009, 8:01am UTC](https://www.ruby-forum.com/t/file-include-error/174003/1 "2009-08-19T08:01:47Z")

</div>

Hello guys,

i want to include file in another file

for ex. i have a file \_search.html.erb & index.html.erb \_search include  
in index using \<% render :partial =\> ‘search’%\> that’s no problem but i  
want to without underscore i mean (search.html.erb)include in index.html  
how this one possible.

---

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 19, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/file-include-error/174003/2 "2009-08-19T13:52:29Z")

</div>

I think you can do it using the render command. Check out the section  
“render a file” from the following link:

> **[ActionController::Base](https://api.rubyonrails.org/classes/ActionController/Base.html#M000658)**
>
> 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.

Hope that helps,  
Jim  
[http://www.thepeoplesfee.com/contribute](http://www.thepeoplesfee.com/contribute)

On Wed, Aug 19, 2009 at 2:01 AM, Wap A.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 19, 2009, 2:23pm UTC](https://www.ruby-forum.com/t/file-include-error/174003/3 "2009-08-19T14:23:54Z")

</div>

James E. wrote:

> I think you can do it using the render command. Check out the section  
> “render a file” from the following link:
> 
> [ActionController::Base](http://api.rubyonrails.org/classes/ActionController/Base.html#M000658)
> 
> Hope that helps,  
> Jim  
> [http://www.thepeoplesfee.com/contribute](http://www.thepeoplesfee.com/contribute)
> 
> On Wed, Aug 19, 2009 at 2:01 AM, Wap A.  
> \<removed\_email\_address@domain.invalid

i can not understood as per ur link if u have any example please give.

---

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 19, 2009, 2:28pm UTC](https://www.ruby-forum.com/t/file-include-error/174003/4 "2009-08-19T14:28:11Z")

</div>

Something like this:

render :file =\> “/path/to/some/template.erb”

On Wed, Aug 19, 2009 at 8:23 AM, Wap A.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 19, 2009, 2:32pm UTC](https://www.ruby-forum.com/t/file-include-error/174003/5 "2009-08-19T14:32:37Z")

</div>

James E. wrote:

> Something like this:
> 
> render :file =\> “/path/to/some/template.erb”
> 
> On Wed, Aug 19, 2009 at 8:23 AM, Wap A.  
> \<removed\_email\_address@domain.invalid

thanks now it is working  
thanks a lot
