Tag: twitter bootstrap

Rails 4,Bootstrap 3,simple_form – 表单样式不起作用

在过去,我使用rails 3.x bootstrap 2.x和simple_form取得了巨大的成功。 但是,我尝试创建一个新的(未升级的)Rails 4 / Bootstrap 3应用程序,虽然simple_form语法能够使用,甚至可以使用嵌套表单,但看起来好像样式不起作用。 我在基于非模型的表单上使用了rails-bootstrap-forms,并且样式看起来很好,但是,我更喜欢在我的大多数表单中使用simple_form。 我的文件如下所示 gem source ‘https://rubygems.org’ gem ‘rails’, ‘4.1.6’ gem ‘mysql2’ gem ‘jquery-rails’ gem ‘devise’ gem ‘sass-rails’ gem ‘coffee-rails’, ‘~> 4.1.0’ gem ‘bootstrap-sass’, ‘~> 3.2.0’ gem ‘autoprefixer-rails’ gem ‘therubyracer’, ‘0.11.4’, :platforms => :ruby gem ‘uglifier’, ‘>= 1.3.0’ gem ‘jquery-ui-rails’ gem ‘less-rails’ gem ‘font-awesome-rails’ gem ‘bootstrap_form’ gem ‘jbuilder’, […]

如何应用自定义的Bootstrap消息错误来设计?

我正在将Bootstrap3错误样式应用于我的Rails4应用程序中的所有消息,这里( 来源 ) def bootstrap_class_for flash_type { success: “alert-success”, error: “alert-error”, alert: “alert-warning”, notice: “alert-info” }[flash_type] || flash_type.to_s end def flash_messages(opts = {}) capture do flash.each do |msg_type, message| concat(content_tag(:div, message, class: “alert #{bootstrap_class_for(msg_type)} fade in”) do concat content_tag(:button, ‘x’, class: “close”, data: { dismiss: ‘alert’ }) concat message end) end nil end end 在同一时间我试图将相同的样式应用于设计错误消息,但它不起作用。 […]

bootstrap:主题错误的常量NameError – > const_defined?

尝试使用Rails 3.2.2运行以下命令,切换到3.2.1并尝试使用另一台机器来查看它是否与核心/操作系统相关。 我试试: rails g bootstrap:themed events 我明白了: .rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:229:in `const_defined?’: wrong constant name event (NameError) from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:229:in `block in constantize’ from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:228:in `each’ from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/inflector/methods.rb:228:in `constantize’ from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/core_ext/string/inflections.rb:54:in `constantize’ from /Users/charleyhine/.rvm/gems/ruby-1.9.3-p0/gems/twitter-bootstrap-rails-2.0.4/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns’ from (erb):6:in `template’

Sprockets :: FileNotFound找不到类型为’text / css’的文件’bootstrap’

所以当我尝试运行rails服务器时,这是我在浏览器中遇到的错误: [couldn’t find file ‘bootstrap’ with type ‘text/css’] 我在我的gemfile中有这个: gem ‘bootstrap-sass’, ‘~> 3.3.5.1’ 这是我的application.css.scss文件: *= require bootstrap *= require_tree . *= require_self */ @import “bootstrap”; 有谁知道如何让它运行起来?

Bootstrap3和简单的forms

以下命令将simple_form与twitter-bootstrap集成在一起 $ rails g simple_form:install –bootstrap identical config/initializers/simple_form.rb create config/initializers/simple_form_bootstrap.rb exist config/locales identical config/locales/simple_form.en.yml identical lib/templates/erb/scaffold/_form.html.erb =============================================================================== Be sure to have a copy of the Bootstrap stylesheet available on your application, you can get it on http://twitter.github.com/bootstrap. Inside your views, use the ‘simple_form_for’ with one of the Bootstrap form classes, ‘.form-horizontal’, ‘.form-inline’, ‘.form-search’ or ‘.form-vertical’, […]

RoR – 将param传递给Bootstrap模态。 背景不淡出

我显示配置文件列表,需要通过模式显示每个用户的更多详细信息: :profile_modal, :profile_id_param => profile.id }, {remote: true, ‘data-toggle’ => ‘modal’, ‘data-target’ => ‘#modal-window’} %> 这是模态的容器fiv: 控制器动作: def profile_modal @profile = Profile.find_by_id(params[:profile_id_param]) respond_to do |format| format.js # format.html end end 和profile_modal.js.erb: $(“#modal-window”).html(“”); $(“#profile_modal”).modal(); 莫代尔: 上面的代码根据params[:profile_id_param]值传递变量,但有两个问题: 打开模态并关闭它后,背景不会再次淡入。 它仍然更暗,只是模态本身消失; 出于某种原因,我无法将当地人传递给模态。 如您所见,我在其中使用了实例变量,因为它使用undefined错误。 这有什么不对? 更新: 在点击时关闭这样的turbolinks: :profile_modal, :profile_id_param => profile.id }, {remote: true, ‘data-turbolinks’ => false, ‘data-toggle’ => ‘modal’, […]

将Bootstrap内容对齐缩略图中的图像右侧

我无法在引导缩略图中将我的标题与我的图像右侧对齐 我的HTML Available on  : ‘remind’ %> 所以目前我的图像位于左侧,标题位于图像下方。是否有一种简单的方法用css将标题设置为div,使其位于图像的右侧

Bootstrap nav下拉菜单仅水平显示(Rails 3.2.13,bootstrap-sass 2.3.1.2,jquery-rails 2.2.1)

在rails项目中使用twitter bootstrap,我的目标是得到这样的东西(简单,通过将下面的代码放入jsfiddle以certificate我不会疯狂,可以轻松实现)。 接下来有一个相当ascii艺术图片,遗憾的是我还不能发布图片: menu1 menu2 my account | item1 | | item2 | ——— HTML看起来像这样 Home Home My Account Home Home 我正在使用Rails 3.2.13和bootstrap-sass 2.3.1.2以及jquery-rails 2.2.1 gems。 我遇到的问题是,无论我做什么,下拉菜单都是水平渲染(并且在错误的位置)。 (再次,请原谅我的ascii艺术 – 抱歉!) home home my account [item1 item2] 我用谷歌搜索,看着堆栈交换,一直在挖掘萤火虫,看看是否有任何明显的我失踪,但没有快乐 – 有没有人知道我使用的gem或版本的bootstrap有问题(那是gem暗示我猜)? 或者对我可能缺少什么有任何建议? 如果它像拼写错误,我使用的实际代码是: Page Logged in as: My Account nav的唯一css覆盖内容如下所示: .navbar .navbar-inner { padding: 0; } .navbar […]

如何使用Twitter中的Bootstrap样式表和Rails中的现有样式表而不会弄乱一切?

所以我在我的Rails应用程序中包含了样式表的URL,但它将所有内容都抛入了haywire。 我把它包括在内: ‘all’) %> 我想要做的是,当我将类应用于html标记时,只应用Twitter样式。 理想情况下,我想要做的是让它甚至覆盖我的“样式”表中的样式 – 这是我整个应用程序的样式表。 是否可以以简单的方式完成此操作,而无需为我想要使用的每个元素修改样式?

前置输入标签(simple_form + bootstrap-sass)关闭几个像素

我想使用这里看到的文本输入字段: http://simple-form-b​​ootstrap.plataformatec.com.br/articles/new (这是该页面上的第二个文本输入字段。) 我有它在其他Rails应用程序中工作但由于某些原因,在我当前的一个在前置标签和文本输入之间有几个像素的间隙。 我已经使用–bootstrap选项安装了–bootstrap ,并validation了Rails / haml / bootstrap / bootstrap-sass版本与working rails应用程序相同。 我没有覆盖我的样式表中的任何相关的CSS(我评论这一切都是肯定的)。 任何想法为什么Bootstrap不应该表现得如此?