My Code book

Posts Tagged ‘image

link_to with image_tag in Rails

Posted by: Purab on: September 15, 2009

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’}  %>

Paperclip with Rails for image manipulation

Posted by: Purab on: September 10, 2009

I used the spree e-Commerce CMS for checking or R&D of Spree code. Spree is the really nice and basic tool for e-Commerce CMS.
When i was going through Spree i got to know about paperclip plugin which is used for image manipulation. Earlier i used “attachment_fu” for image manipulation and file uploading in rails projects.
How [...]


Add This page

Bookmark and Share

Blog Stats

  • 13,796 hits

Purab’s Twittes