简体   繁体   English

Rails bootstrap-navbar宝石

[英]Rails bootstrap-navbar gem

I'm trying to create a Rails application using the bootstrap-navbar gem ( https://github.com/bootstrap-ruby/bootstrap-navbar ), but I can't find anywhere in the documentation that says to which file I'm supposed to add the directives to. 我正在尝试使用bootstrap-navbar gem( https://github.com/bootstrap-ruby/bootstrap-navbar )创建一个Rails应用程序,但是在文档中找不到我说哪个文件的地方我应该在其中添加指令。

I'm not super experience with bootstrap and a lot of the new layout/css frameworks and libraries out there these days, so I'm sure the answer is obvious, but I certainly can't find it. 这些天来,我对引导程序和许多新的layout / css框架和库都不是超级有经验,所以我敢肯定答案是显而易见的,但我当然找不到。

The example shows how to make a navbar (heres a snippet from https://github.com/bootstrap-ruby/bootstrap-navbar/wiki/Usage-with-Bootstrap-3 ), but I have no idea where to put this: 该示例显示了如何制作导航栏(此处为https://github.com/bootstrap-ruby/bootstrap-navbar/wiki/Usage-with-Bootstrap-3的摘录),但我不知道将其放在何处:

= navbar fixed: :top do
  = navbar_header brand: 'My great app', brand_link: '/home'
  = navbar_collapse do
    = navbar_group class: 'foo', id: 'menu' do
      = navbar_text 'Pick an option:'
      = navbar_item "Home", '/'
      = navbar_item "About Us", '/about-us'
      = navbar_item '/contact' do
        %span.glyphicon.glyphicon-hand-right
        Contact Us!

Thanks for helping a Rails noob! 感谢您对Rails新手的帮助! I've tried putting it in my templates and in helpers, but it doesn't look like actual Ruby, so I'm sure I'm missing something here. 我尝试将其放在模板和帮助器中,但它看起来并不像真正的Ruby,因此我确定我在这里遗漏了一些东西。

显然,这只是常规erb模板语言的一些伪代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM