Tag: twitter bootstrap

如何使用Bootstrap表单选择带有Rails模型的css?

我想使用Bootstrap css在Ruby on Rails应用程序中为表单中的“选择”框设置样式。 在Bootstrap站点上,他们以此为例: 1 2 3 4 5 但是,我无法弄清楚如何将此方法与我想要选择区域的rails代码上的ruby结合起来,以便将所选选项保存到我表中的正确列(:ampm here)中。 这是我目前的代码。 它工作,但没有我想要的引导程序外观: 我尝试了很多方法将Bootstrap示例与我的代码集成,但没有任何方法可行。 任何帮助表示赞赏。

“bootstrap-sass”不适用于rails 3.2.2

我创建了一个新的rails项目,并添加 gem ‘bootstrap-sass’ 到我的Gemfile,然后我运行bundle install并且每件事情都很顺利。 然后我补充说: /* *= require bootstrap */ 在我的application.css文件中,我写了一个测试,但它没有。 我也尝试添加`@ import“bootstrap”; 在我的hello.css.scss文件中。但它也不起作用。

带有Bootstrap的simple_form复选框

我正在使用带有Bootstrap的simple_form,我希望我的“记住我”复选框位于标签的左侧,如Twitter Bootstrap文档中所示: http : //twitter.github.com/bootstrap/base- css.html#forms 我的表单代码如下所示: resource_name, :url => session_path(resource_name), :html => { :class => ‘well’}) do |f| %> :boolean if devise_mapping.rememberable? %> 结果是复选框顶部的“记住我”标签。 我搞砸了什么?

使用来自Twitter Bootstrap的Typeahead表格(formtastic)

如何从bootstrap集成一个typeahead,如下所示: 进入这样的标准forms:

应该如何在ruby中查看application.scss文件?

我是ruby中的新手,我的代码看起来像这样:这是正确的吗? 我的boostrap不加载.. 所以application.scss //= require . //= require_self //= require jquery //= require jquery_ujs //= require turbolinks //= require bootstrap //= require_tree . @import “bootstrap-sprockets”; @import “bootstrap”; 而application.js看起来像这样: // This is a manifest file that’ll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this […]

Rails在呈现不必要的信息

我一直在使用RoR和Bootstrap,我试图将我的代码渲染到我在网上发现的代码片段中。 基本上我在我的索引中有这个: … … 但是,它呈现了应该以此格式呈现的每个项目的批量信息: [#] 如果有人能给我任何提示,那就太好了。 至少告诉我一点这个渲染代码的格式,这太棒了。

Errno :: ENOENT没有这样的文件或目录Rails 4

显示第5行引发的“/Users/Christian/Desktop/sample_app/app/views/layouts/application.html.erb”: 没有这样的文件或目录 – / Users / Christian / Desktop / vendor / assets(在/Users/Christian/Desktop/sample_app/app/assets/stylesheets/custom.css.scss中) true %> true %> ` 我正在开发linux ubuntu,它在那里工作正常,我将文件夹复制到我的mac,它不再有效。 custom.css.scss位于正确的位置 问题出在第5行: true %>`

当我执行“捆绑更新”时,我从gem中获取错误,而不是在我的gemfile中。 我如何忽略这种依赖?

我正在使用一个使用twitter-bootstrap-rails的项目。 这个项目是在Linux机器上构建的,并使用therubyracer作为javascript运行时。 我一直在遇到问题,因为therubyracer似乎与Windows并不相处。 在windows上的therubyracergem 现在我正在尝试“捆绑更新”; “therubyracer”令人窒息。 我想我应该能够依靠JScript。 我如何告诉bundler忽略这一点,而不是深入研究每个gem并手动删除它对therubyracer的依赖? 看起来像bootstrap,或者至少是twitter-bootstrap-rails,取决于therubyracer。 编辑:我已经按照该线程中的说明进行操作,并且我继续获得以下内容(在安装捆绑软件之后): Installing railties (3.2.0) Installing coffee-rails (3.2.2) Installing libv8 (3.3.10.4) with native extensions Installing therubyracer (0.9.10) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. C:/Ruby/bin/ruby.exe extconf.rb creating Makefile make generating v8-i386-mingw32.def compiling rr.cpp cc1plus.exe: warning: command line option “-Wdeclaration-after-statement” is valid for C/ObjC […]

告诉Bundler从特定gem的安装中排除某些gem

在gemfile中,有什么方法可以告诉Bundler: gem ‘twitter-bootstrap-rails’, :exclude therubyracer 我需要安装twitter-bootstrap-rails但是它会自动拉therubyracer ,因此bundle install失败并且bootstrap不包含在项目中,因为这是一台Windows机器。 我安装了execjs无济于事。 我试图在生产中列出therubyracer ,并bundle install –without production – 没有bundle install –without production ,也无济于事。 “ windows上的therubyracer gem ”也是这个问题,但没有任何建议改变了我得到的错误。 我的旧线程是“ 当我做”捆绑更新“时,我从gem中得到一个错误而不是我的gemfile。如何忽略这种依赖? ”。

将设计sign_in表单设置为Twitter Bootstrap Modal

好的,所以我想使用twitter bootstrap模式来显示设计登录表单。 我在这里基于wiki文章的代码: https : //github.com/plataformatec/devise/wiki/How-To : -Display-a- custom-sign_in-form-anywhere-in-your- app 我的应用程序布局文件中有以下标记 × Sign In resource_name, :url => session_path(resource_name), :html => {:class => ‘form-horizontal’}) do |f| %> false, :autofocus => true %> false %> :boolean if devise_mapping.rememberable? %> ‘btn btn-primary’, :data => { :dismiss => “modal”} %> 并且,根据Wiki中的建议,将以下内容添加到应用程序帮助程序文件中 def resource_name :user end def resource @resource ||= […]