On Tue, May 01, 2007 at 09:15:47PM +0200, Steven Garcia wrote:
> I am using a helper method to generate my search result listings:
> 
> def search_result_name(result)
>      case result
>      when Term
>        "<h2>#{result.title}</h2>
>        <small>Filed under: <strong>Terms</strong></small>"
>      when Article
>        "<h2>#{result.title}</h2>
>        <small>Filed under: <strong>Articles</strong></small>"
>      else
>        result.to_s
>      end
>    end
> 
> This works perfectly, but I hit a wall when I try to include a link  
> in the above method. I try using a link_to helper inside a string  
> interpolation block but Rails does not parse the helper.

strange, I often use link_to in helpers, i.e. to embed links in list
elements:

def navsec_link(text, link, options = {})
  "<li>#{link_to text, link, options}</li>"
end


Jens

-- 
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
 
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to