[Html] dropdown menu

解答

<div class="dropdown clearfix pull-right">
    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenuDivider" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
      排序
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" aria-labelledby="dropdownMenuDivider">
        <li>
          <%= link_to("按照薪资下限排序", jobs_path(:order => "by_lower_bound")) %>
        </li>
        <li>
            <%= link_to("按照薪资上限排序", jobs_path(:order => "by_upper_bound")) %>

        </li>
        <li>
          <%= link_to("按照发表时间排序", jobs_path ) %>

        </li>
    </ul>
</div>

自己的猜測
```ruby


```
但這樣沒有按鈕
要加個
span 無意義但 caret就是會加一個

ruby
<div class="pull-right">
<button data-toggle="dropdown" >
排序
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuDivider">
<li>
<%= link_to("按照薪资下限排序", jobs_path(:order => "by_lower_bound")) %>
</li>
<li>
<%= link_to("按照薪资上限排序", jobs_path(:order => "by_upper_bound")) %>
</li>
<li>
<%= link_to("按照发表时间排序", jobs_path ) %>
</li>
</ul>
</div>

data-toggle
https://kkbruce.tw/bs2/JavaScript

comments powered by Disqus