Tag: twitter bootstrap

SSL问题安装bootstrap gem

我在Gemfile中添加了bootstrap gem,当我尝试运行bundle install时 。 它显示以下错误! Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Users\Nir>cd c:\Sites\FrogBlog c:\Sites\FrogBlog>bundle install Fetching source index from https://rails-assets.org/ Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError C ould not verify the SSL certificate for https://rails-assets.org/. There is a chance you are experiencing a man-in-the-middle attack, but most like ly […]

使用css,twitter-bootstrap和simple_form对各个布尔值的复选框进行分组

你能帮我格式化这个simple_form吗? 我使用这个表格: { :class => ‘form-horizontal’} do |f| %> {:class => “span6”, :rows => 2}%> {:class => “span6”, :rows => 2}%> :hidden, :input_html => { :value => @my_model.id }%> ‘btn-primary’ %> t(“helpers.links.cancel”)), special_path, :class => ‘btn’ %> 我想将布尔值显示为两列复选框,每列垂直堆叠,每列有4个复选框。 就像是 Some text: [input] A description: [input] bool1 bool5 bool2 bool6 bool3 bool7 bool4 bool8 我在这里克隆了git存储库http://simple-form-b​​ootstrap.plataformatec.com.br/articles/new ,查看代码,运行它,我看到它有效。 […]

Twitter引导Rails 3中的语言环境选择器下拉列表

我在一般的Bootstrapped Rails 3应用程序中有一个非Bootstrapped语言环境选择器,我想要Bootstrap-ify。 关于如何在下拉菜单中的表单中创建(我假设)无序列表,我有点难过。 TL; DR转到此问题底部的编辑3以获取已完成的解决方案。 当前代码以下列方式实现: 应用程序/视图/布局/ _header.html.haml %header.navbar.navbar-fixed-top .navbar-inner .container # … %nav %ul.nav.pull-right # … %li= render ‘layouts/locale_selector’, controller: controller, action: action # (controller, action params passed in from application.html.haml) 应用程序/视图/布局/ _locale_selector.html.haml = form_tag({ controller: controller, action: action }, method: ‘get’, class: ‘locale’) do = select_tag ‘set_locale’, options_for_select(locale_languages, I18n.locale) = hidden_field_tag ‘page’, […]

运行rake资产:在bootstrap gem版本之间来回切换时进行预编译?

使用bootstrap-sass gem开始使用Bootstrap 2.3开始的项目,在我的gemfile中指定版本2.3.1.0。 我想将它更新为Bootstrap 3。 这是使用bootstrap-sass gem version 2.3.1.0的应用程序的样子: 我检查了一个分支,试验将样式更新为Bootstrap 3,所以我更新了我的gemfile以使用最新版本的bootstrap-sass gem,运行bundle update并安装。 我在上面看到的每个“神奇点”div元素上都有bootstrap 3版本类,所以英雄单元中的样式应该消失,按钮应该变平,并且惊人的点应该跨越4列“col-lg” -4“我已经指定了。 但是当我启动rails服务器时,我得到了Bootstrap 2.3和3的混合: “col-lg-4”类应用于Amazing Points,但登录和注册按钮仍然看起来像Bootstrap 2.3按钮! “登录”和“注册”文本中有一个微妙但可见的变化 – 它更加大胆。 这就像我有一些奇怪的Bootstrap 2.3和3的混合。 但现在我运行rake资产:预编译,这就是我得到的: 现在事情正确显示。 但为什么我总是要运行rake资产:预编译以使其正常工作? 当我在gem文件之间切换时,我怎么能把它自动更新? 以下是其他相关文件: application.css: /* * This is a manifest file that’ll be compiled into application.css, which will include all the files * listed below. * * […]

bootstrap:主题在简单的脚手架上失败

我有一个带有post脚手架的rails应用程序,它只有一个title属性。 一切看起来都不错,但是当我尝试使用Twitter Bootstrap来构建脚手架时,它会引发以下错误: rails g bootstrap:themed posts /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:226:in `const_defined?’: wrong constant name post (NameError) from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:226:in `block in constantize’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `each’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `constantize’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.0/lib/active_support/core_ext/string/inflections.rb:54:in `constantize’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/twitter-bootstrap-rails-2.0.4/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns’ from (erb):6:in `template’ from /Users/templeb3/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/erb.rb:838:in `eval’ from /Users/templeb3/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/erb.rb:838:in `result’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:111:in `block in template’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `call’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `render’ from /Users/templeb3/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:47:in `identical?’ from […]

在资产管道中编辑我的SASS样式表似乎打破了资产管道

这让我疯了 – 我有一个基于Bootstrap的Rails应用程序。 我已经连续几周了,今天我遇到了一个非常奇怪的问题。 如果我对任何样式表进行任何微不足道的更改(即添加新行并保存),我会松散一堆CSS格式。 如果没有一些如何发布我的所有代码等,这很难解释。最大的症状是丢失了我的Google字体。 这是我的application.css.scss文件的顶部: @import “font-awesome-sprockets”; @import “font-awesome”; @import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,400,300,600,700); /*** BOOTSTRAP ***/ /* Needs to load first to overide the default CSS */ @import “bootstrap_custom”; @import “bootstrap-sprockets”; @import “bootstrap”; @import “timeline”; 在此之后我还有一些自定义CSS。 字体真棒和bootstrap CSS似乎仍然加载。 似乎消失的CSS代码是bootstrap_custom。 这是我的导航栏我有谷歌字体和一些自定义CSS的地方。 重新启动rails服务器无法修复它。 替换已编辑的css文件不起作用。 我真的必须恢复整个app目录的旧版本。 如果我用终端或TextMate更改文件并不重要 – 结果相同。 如果重要的话,我在OS X 10.10.1上运行Rails 4.1.8。 我必须hame配置错误或有一些奇怪的Rails服务器缓存或设置我在这里丢失。 我必须恢复整个app目录的事实会让我相信这一点。 UPDATE 我认为这是一个SASS或Bootstrap-sass问题。 我通过在线文件比较网站从两个版本运行CSS。 […]

twitter bootstrap模态数据属性参数中的html文本

这来自Twitter Bootstrap模态rails删除按钮不起作用 如何传递html代码以在Twitter Bootstrap模式中显示? 链接在这里 raw(post.text), class: ‘label’ %> post.text是HTML代码。 现在它显示格式错误的链接。 谢谢

Twitter Bootstrap .popover()函数在Rails中不起作用

我正在尝试使用Twitter Bootstrap for Rails。 popover()函数根本不起作用。 什么都没发生。 layouts/application.html.erb : $(function () { $(“a[rel=popover]”) .popover({ offset: 10 }) .click(function(e) { e.preventDefault() }) }); 这是我的views/test/test.htlm.erb : + Test 我的Gemfile的一部分: gem ‘rails’, ‘3.1.3’ gem ‘jruby-openssl’ gem ‘json’ group :assets do gem ‘sass-rails’, ‘~> 3.1.5’ gem ‘coffee-rails’, ‘~> 3.1.1’ gem ‘uglifier’, ‘>= 1.0.3’ gem ‘jquery-rails’ end 我还尝试在我的application.js文件中复制/粘贴twipsy.js和popover.js ,并在我的layouts / application.html.erb中调用它: […]

Bootstrap更改Navbar链接颜色

我知道这个话题已经被打死了,但我读到的内容并没有奏效。 我只是想将我的bootstrap导航栏中的链接更改为白色。 我知道我有CSS,因为我可以改变字体大小,但不能改变颜色。 nav .navbar-nav li{ color: white !important; font-size: 25px; } Bartlett Containers LLC

如何强制rake资产:预编译为生产RefineryCMS生成单独的JS文件?

我正在使用RefineryCMS,在管理部分我需要包含一个JS文件。 为此,您必须设置配置值 config.register_javascript “bootstrap.modal” http://antonivanopoulos.com/refinerycms-admin_restyle-a-gem-to-make-refinery-cms-a-little-prettier/ 它在开发中有效。 当我预编译资产以进行生产时,RefineryCMS管理页面会出现404错误,因为bootstrap.modal-7bc4667810e04a7a7ccf02099c81a882.js在公共/资产中不存在。 相反,它嵌入在Refinery管理员不使用的application.js中。 Refinery将为该文件插入单独的JS标记: 该文件作为应用程序资产存在,但不会被指纹识别为其自己的文件。 $ ls app/assets/javascripts/bootstrap.modal.js app/assets/javascripts/bootstrap.modal.js $ rake assets:precompile … $ ls public/assets/boot* ls: cannot access public/assets/boot*: No such file or directory 我不能只包含application.js,因为还有很多东西会破坏管理页面的显示。 我阅读了整个资产管道指南但没有发现任何有用的东西 http://guides.rubyonrails.org/asset_pipeline.html Rails 3.2.14。