当用户单击图像区域时,我想触发并向服务器发出 ajax 请求。有没有一种简单的方法来实现这个 a-la Rails 3 UJS?类似于 link_to ..., :remote=>true 的东西?
我尝试了以下代码:
#post_bar
=image_tag 'post_bar_270x57.png', :usemap=>'#add_post'
%map{:name=>"add_post"}
%area{:shape=>"rect", :coords=>"40,4,86,50", :href=>new_message_path, :'data-remote'=>'true', :title=>"Message"}
但添加的数据远程属性不起作用。
谢谢你的帮助。