开发者

Rails3 - changing links into graphic button

I would like to change the开发者_运维问答 standard links and buttons in Rails to a graphic version. How would I achieve this?

Rails3 - changing links into graphic button


Well, for standard links, you can do something like:

<%= link_to image_tag('/images/link.png'), link_path %>

For submit buttons, you can use the image_submit_tag helper within your form:

<%= form_for ... %>
    <%= image_submit_tag '/images/submit.png' %> 
<% end %> 


Given how reduced the graphic version is, why not use CSS? No need to change any of the mark–up or template tags. — http://jsfiddle.net/ry5KD/ (super–reduced example!).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜