我的移动应用程序需要帮助<%= link_to 'Eliminar', category, :confirm => "Eliminar categoria ?", :method => :delete %>
但链接不起作用,
答案 0 :(得分:0)
点击您手机上的链接并检查您的控制台它实际上是否采取了行动。我认为我可能是一个CSS问题,其他一些元素可能会重叠。
<%= link_to "/categories/#{categoty.id}", method: :delete, data: { confirm: 'Are you sure?' },:class=>"btn btn-danger",:title=>"Remove" do %><i class="fa fa-trash-o"></i><%end%>
答案 1 :(得分:0)
<% @articles.each do |article| %>
<div class="mobile-article-index">
<div data-role="navbar">
<div class="mobile-normal">
<ul>
<li >
<%=link_to article.page.name, article.page %>
</li>
<li >
<%=link_to article.title, article %>
</li>
<%= article.created_at.strftime("%B %e, %Y") %>
</ul>
</div>
<div class="mobile-normal" style="font-size: 80%">
<%=image_tag article.image_url.to_s, :width=>"60%;",:height=>"78px;",:style => " border-radius: 5px;"%>
<%= raw summarize(article.body, 190) %><%=link_to "read more" ,article ,:class=>"page-button"%>
<%= link_to '<i class="glyphicon glyphicon-trash"></i> Delete '.html_safe, article, method: :delete, data: { confirm: 'Are you sure?' },:style=>"color:red" %>
</div>
</div>
</div>
<br>