I would like to change the开发者_运维问答 standard links and buttons in Rails to a graphic version. How would I achieve this?
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!).
精彩评论