문제

With link_to, we can embed content like this:

<%= link_to '#' do &>
  <img>

By doing so, we could change a text link into other.

However, When using forms, the button is achieve in html using <input>, and I'm unable to replace it like link_to. How can I do something like:

<%= f.submit "#" do %>
  <img>
도움이 되었습니까?

해결책

You should use image_submit tag instead of f.submit

다른 팁

<%= image_submit_tag("/images/submit.png") %>

or HTML

<input alt="Submit" src="/images/submit.png" type="image" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top