使用自定义帮助器方法生成带有链接和html选项的html标记的最佳方法是什么?
让我们说
def drop_document_options(title,document,version,html_options)
end
为了生成带参数的链接:
<div class="dropdown">
<button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown">
<%=@hebrew_document[document]%> - <%=@hebrew_version[version]%>
<span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li> <%=link_to( {:controller => "invoices",
:action => "download",
:id => document.id,
:disposition => 'inline',
:version => version[i]} ,
html_options ) do %>
<%=action_title%>
<% end %>
</li>
</ul>
</div>