将代码从AngularJS重构为RailsBootstrap

时间:2013-12-11 03:40:29

标签: ruby-on-rails-3 angularjs twitter-bootstrap

如何将此代码重构为带有4列网格的Rails引导程序:

<div ng-show="chooseNeighborhoodsVis">
  <div ng-repeat="hood in neighborhoods">
        <input type="checkbox" name="user[neighborhood_ids][]"
            value="{{ hood.id }}" ng-click="countHoods(hood.name)">{{ hood.name }}
  </div>
</div>

1 个答案:

答案 0 :(得分:2)

如果您使用的是Twitter bootstrap,那么您可以执行此操作。

<div class="row">
  <div class="col-xs-6 col-md-3">Column 1</div>
  <div class="col-xs-6 col-md-3">

    <!-- Your Code Goes Here -->

  </div>
  <div class="col-xs-6 col-md-3">Column 3</div>
  <div class="col-xs-6 col-md-3">Column 4</div>
</div>