Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/414.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 为rails 3中的按钮提供图像_Javascript_Ruby On Rails 3.1 - Fatal编程技术网

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"