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 : http://s8.postimage.org/mhcrs61w3/Scree … _38_42.png ), using http://web.enavu.com/tutorials/making-i … 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 -->
    </div>
    <!-- end description div -->
  </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 %>

generate

<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 : http://paulsturgess.co.uk/articles/49-u … y-on-rails