开发者

How to use link_to inside select_tag? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit t开发者_Go百科he help center. Closed 11 years ago.

How can I use link_to inside select_tag ? Something like this ...

<%= select_tag "test1","<option>#{link_to 'View Details', view_path(test)}</option><option>#{link_to 'Delete', delete_path(test)}</option><option>#{link_to 'Edit Details', edit_path(test)}</option>"%>

Any solution ?


<%= select_tag "test1","<option value='#{view_path(test)}'>View Details</option><option value='#{delete_path(test)}'>Delete</option><option value='#{edit_path(test)}'>Edit Details</option>" ,:onchange => "window.open(this.options[this.selectedIndex].value,'_top')" %>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜