开发者

Rails 3 - how to apply link_to on image_tag with :remote => true attrubute

开发者 https://www.devze.com 2023-03-25 06:40 出处:网络
I am struggling with problem about right setting parameters for image, that is link. Concrete, this works

I am struggling with problem about right setting parameters for image, that is link. Concrete,

this works

<%= link_to (image_tag 'img name', 
            :class => 'css'),
        ({controller, action, paramet开发者_C百科er})%>

this already not works

<%= link_to (image_tag 'img name', 
            :class => 'css'),
        ({controller, action, parameter},
        {:remote => true})
%>

May you will think it's very low question, but I am trying to solve it more than half hour and still nothing... so I will appreciate for each of help.


You can try this. (not tested myself)

<%= link_to(image_tag('img name', :class => 'css'), url_for(:controller => 'controller_name', :action => 'action_name'), :remote => true) %>

0

精彩评论

暂无评论...
验证码 换一张
取 消