Forum: Ruby on Rails processing code within a partial

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.
1edaed247dd200ae6387adf51e99f19c?d=identicon&s=25 William Zumwalt (ender)
on 2006-04-05 19:41
I'm doing layouts and I have a question on how to process <%= ... %>
tags within partials.

I have a standard.rhtml file with :

<div id="header"><%= render_partial "layouts/header" %></div>


and my _header.rhtml contains a tag as such:

<link_to "Categories", :controller => "categories", :action=> "list" %>

Yet when I run my page in the browser, all I see is the text contained
in the header and it looks like it's not being processed.

Any help?
A5d8283732da86365736508fef6c1c67?d=identicon&s=25 Nuno (Guest)
on 2006-04-05 19:59
William Zumwalt wrote:
> I'm doing layouts and I have a question on how to process <%= ... %>
> tags within partials.
>
> I have a standard.rhtml file with :
>
> <div id="header"><%= render_partial "layouts/header" %></div>
>
>
> and my _header.rhtml contains a tag as such:
>
> <link_to "Categories", :controller => "categories", :action=> "list" %>
>
> Yet when I run my page in the browser, all I see is the text contained
> in the header and it looks like it's not being processed.
>
> Any help?

May be it's a typo but you should add <% in front of link_to
This topic is locked and can not be replied to.