0

我有带有 Twitter bootstrap 2.1.0 的简单 RoR 3.2 应用程序(我通过 twitter-bootstrap-rails gem 实现了它)。我想将侧边栏与几个链接集成(正如您在左侧的 twitter 引导页面上看到的那样),但我不知道如何实现这一点(是的,我是菜鸟)。有没有人有解决方案如何在 Rails 中做到这一点?

我的应用程序布局:

!!!
%html
  %head
    %title MyApp
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    = csrf_meta_tags
    %meta{ :name => "viewport", :content => "width=device-width, initial-scale=1.0"  }
  %body
    %div{ :class => "wrapper" }
      = render 'layouts/navbar_template'

      %div{ :class => "container-fluid" }
        - flash.each do |key, msg|
          %div{ :class => "alert alert-#{key}" }
            %button{ :type => "button", :class => "close", "data-dismiss" =>"alert" }×
            = msg
        %div{ :class => "row-fluid" }
          %div{:class => "span10"}
            =yield
          %div{:class => "span2"}
            -# I would like to have sidebar here
4

1 回答 1

0
%ul.nav.nav-list.bs-docs-sidenav.affix
  %li.active
    %a{:href => "#dropdowns"}
      %i.icon-chevron-right
      Dropdowns
  %li
    %a{:href => "#buttonGroups"}
      %i.icon-chevron-right
      Button groups
  %li
    %a{:href => "#buttonDropdowns"}
      %i.icon-chevron-right
      Button dropdowns
  %li
    %a{:href => "#navs"}
      %i.icon-chevron-right
      Navs
  %li
    %a{:href => "#navbar"}
      %i.icon-chevron-right
      Navbar
  %li
    %a{:href => "#breadcrumbs"}
      %i.icon-chevron-right
      Breadcrumbs
  %li
    %a{:href => "#pagination"}
      %i.icon-chevron-right
      Pagination
  %li
    %a{:href => "#labels-badges"}
      %i.icon-chevron-right
      Labels and badges
  %li
    %a{:href => "#typography"}
      %i.icon-chevron-right
      Typography
  %li
    %a{:href => "#thumbnails"}
      %i.icon-chevron-right
      Thumbnails
  %li
    %a{:href => "#alerts"}
      %i.icon-chevron-right
      Alerts
  %li
    %a{:href => "#progress"}
      %i.icon-chevron-right
      Progress bars
  %li
    %a{:href => "#misc"}
      %i.icon-chevron-right
      Misc
于 2012-09-05T13:23:03.807 回答