开发者

Rails3 - changing links into graphic button

开发者 https://www.devze.com 2023-03-09 06:35 出处:网络
I would like to change the开发者_运维问答 standard links and buttons in Rails to a graphic version. How would I achieve this?

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

精彩评论

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