Javascript 为rails 3中的按钮提供图像
在下面的代码中,是否有任何方法可以更改为按钮提供图像Javascript 为rails 3中的按钮提供图像,javascript,ruby-on-rails-3.1,Javascript,Ruby On Rails 3.1,在下面的代码中,是否有任何方法可以更改为按钮提供图像 <%= button_to 'Edit treatment', edit_treatment_path(@treatment), :type => "submit", :class => "style3", :method => "get" %> “提交”、:类=>“样式3”、:方法=>“获取”%> 如果您试图通过图像单击提交表单(假设您的类型为“提交”),您可以使用 image_submit_tag("you
<%= button_to 'Edit treatment', edit_treatment_path(@treatment), :type => "submit", :class => "style3", :method => "get" %>
“提交”、:类=>“样式3”、:方法=>“获取”%>
如果您试图通过图像单击提交表单(假设您的类型为“提交”),您可以使用
image_submit_tag("your_image.png", :class => "style3")
link_to image_tag("your_image.png"), edit_treatment_path(@treatment), :class => "style3"
如果你的意思是一个标准的按钮,你可以使用
image_submit_tag("your_image.png", :class => "style3")
link_to image_tag("your_image.png"), edit_treatment_path(@treatment), :class => "style3"