link_to

1
2
3
4
5
6
7
关注
```<% if !current_user.already_follower?(@user) %>
<i class="fa fa-heart" aria-hidden="true"></i>
<% else %>
<i class="fa fa-heart-o" aria-hidden="true"></i>
<% end %>
<% end %>
1
2
3
4
5
6
7
8
9
10
```ruby
<%=link_to_if(question.answers.count>0, "删除"
,publish_hidden_account_question_path(question)
, method: :post, data: { confirm: 'Are you sure you want to delete the question?' }
, class:"btn btn-primary btn-xs",disabled:true) do
link_to("删除",publish_hidden_account_question_path(question), method: :post
, data: { confirm: 'Are you sure you want to delete the question?' }
, class:"btn btn-primary btn-xs")
end %>