Topic: [SOLVED] Make a link_to like function

Hello, (I'm new on Ruby on Rail).

I'm making a site with icon (as you can see here : … _38_42.png ), using … using-css/

The code looks like this :

  <!-- wrapper div -->
  <div class='icon'>
    <!-- image -->
   <img src='IMAGE_LINK' />
    <!-- description div -->
    <div class='icon_title'>
      <!-- description content -->
      <p class='icon_title_content'><%= TEXT %></p>
      <!-- end description content -->
    <!-- end description div -->
  <!-- end wrapper div -->

And i'd like to be able to create it with somesing like

<%= icon 'TEXT', 'IMAGE_LINK' %>

Using the same method that

<%= link_to 'TEXT', LINK %>


<a href="LINK">TEXT</a>

Thanks for reading and sorry about bad english.
I didn't search much before posting because I didn't know wich keyword use.

Last edited by gheaeckkseqrz (2012-10-28 09:54:30)

Re: [SOLVED] Make a link_to like function

Found !

Those link_to like functions are called helpers : … y-on-rails