Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.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
Ruby on rails 带有数据url和方法的Span_Ruby On Rails_Html - Fatal编程技术网

Ruby on rails 带有数据url和方法的Span

Ruby on rails 带有数据url和方法的Span,ruby-on-rails,html,Ruby On Rails,Html,我有这个跨度,我想为数据url设置POST方法,但这不起作用 <span class="ajax-popup" method="POST" data-url="/profiles/<%= current_user.id %>/change_image?type=avatar"> <%= image_tag 'back-drop-cam.png' %> <p>Change Avatar</

我有这个跨度,我想为数据url设置POST方法,但这不起作用

<span class="ajax-popup" method="POST" data-url="/profiles/<%= current_user.id %>/change_image?type=avatar">
              <%= image_tag 'back-drop-cam.png' %>
              <p>Change Avatar</p>
 </span>

改变化身


不要使用
方法
使用
数据方法

<span class="ajax-popup" data-method="POST" data-url="/profiles/<%= current_user.id %>/change_image?type=avatar">
method = $(this).attr("data-method")