Render :file question


#1

Hi,

I have a layout xyz.rhtml. And a footer.rhtml. Both these files reside
in app/views/layouts/.

In that layout, I am making a call like this:

        <%= render :file => "footer",  :use_full_path => true%>

I have also tried:

        <%= render :file => "footer"%>

footer.rhtml is in the same directory as in xyz.rhtml.

I get this exception:

Showing /app/views/layouts/xyz.rhtml/ where line #20 raised:

|No rhtml, rxml, or delegate template found for footer|

Extracted source (around line #20):

|17:
18:
19:


20: <%= render :file => “footer”, :use_full_path => true%>
21:

22:
23:
|

Que 1: Why is it not finding footer.rhtml?

Que 2: footer.rhtml is like a view component, is this the best way to do
this and place to put this file?
(Note: I know about render :partial, question 2 is more of a design /
code arrangement question)

Thanks,


#2

Does anyone know what I might be doing wrong ? I can provide additional
information to solve this issue.

Thanks,


#3

Hi,

I am a bit perplexed and would really like someone to shed some light on
this issue.

I have a layout xyz.rhtml. And a footer.rhtml. Both these files reside
in app/views/layouts/.

In that layout, I am making a call like this:

       <%= render :file => "footer",  :use_full_path => true%>

I have also tried:

       <%= render :file => "footer"%>

footer.rhtml is in the same directory as in xyz.rhtml.

I get this exception:

Showing /app/views/layouts/xyz.rhtml/ where line #20 raised:

|No rhtml, rxml, or delegate template found for footer|

Extracted source (around line #20):

|17:
18:
19:


20: <%= render :file => “footer”, :use_full_path => true%>
21:

22: 23: |

Que 1: Why is it not finding footer.rhtml?

Que 2: footer.rhtml is like a view component, is this the best way to do
this and place to put this file?
(Note: I know about render :partial, question 2 is more of a design /
code arrangement question)

Thanks,