This is very basic form tag in rails. but some time you get confused about using this tag.

How to displays a image inside link_to instead of text?

Here is answer:
<%= link_to image_tag(“/images/submit.jpg”, :border=>0), :action => ‘create’ %>

Section Option:

<%= link_to image_tag(“/images/submit.jpg”, :border=>0,:class=>’sub20′), :url =>{:controller=> ‘user’,:action=>’create’}  %>

Written by Purab

My name is Purab, Here is my Personal Blog: I contributor of many wordpress plugins and Drupal Modules. I am core developer of Drupal. Connect to on LinkedIn or Follow @purab on Twitter or Follow me on Google+ or Write Mail to or Chat with me on Skype : purabdk

This article has 2 comments

  1. Marine Highers Reply

    Amazing site, where did you come up with the information in this piece of content? I’m happy I found it though, ill be checking back soon to see what other articles you have.

  2. Joy Finken Reply

    This is a really good write-up, I discovered your website researching google for a similar topic and arrived to this. I couldnt discover to much alternative information on this posting, so it was pleasant to discover this one. I likely will end up being back again to look at some other posts that you have another time.

Leave a Comment

Your email address will not be published. Required fields are marked *