开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜