Forum: Ruby on Rails render :file question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3320715fa6264e6309503d5bd089fad2?d=identicon&s=25 Mufaddal Khumri (mkhumri)
on 2006-01-16 17:55
(Received via mailing list)
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: 			</div>
18: 		</div>
19: 		<div>
20: 			<%= render :file => "footer",  :use_full_path => true%>
21: 		</div>
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,
3320715fa6264e6309503d5bd089fad2?d=identicon&s=25 Mufaddal Khumri (mkhumri)
on 2006-01-16 19:41
(Received via mailing list)
Does anyone know what I might be doing wrong ? I can provide additional
information to solve this issue.

Thanks,
3320715fa6264e6309503d5bd089fad2?d=identicon&s=25 Mufaddal Khumri (mkhumri)
on 2006-01-17 01:27
(Received via mailing list)
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:             </div>
18:         </div>
19:         <div>
20:             <%= render :file => "footer",  :use_full_path => true%>
21:         </div>
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,
This topic is locked and can not be replied to.