Tag: twitter bootstrap

Ruby on Rails中的Bootstrap工具提示

我现在试着把这件事做了很长一段时间,我无法弄清楚什么是错的: 我的链接: {:toggle=>”tooltip”}, ‘data-original-title’ => “Hey Whats up”, ‘data-placement’ => ‘right’%> 我的Javascript: $(‘.tag-tooltip’).tooltip(); 但它不起作用……我缺少什么? 编辑 如果我进入我的Chrome控制台并插入( $(’。tag-tooltip’)。tooltip(); )它正在运行。 所以我猜js文件没有加载? (我检查了我的application.js,我要求一切。)

Rails使用Twitter Bootstrap设计I18n Flash消息

你好我是ruby on rails的新手,我很难理解I18n的flash消息。 我正在使用devise,rails 4和twitter bootstrap。我明白设计只使用flash[:notice]和flash[:alert] 。 我可以通过登录和注销来获取适用于我的用户模型的Flash消息。 但是,我无法获得注册的Flash错误或忘记密码才能正常显示。 它看起来像是默认的错误消息。 我看了很多与此相关的问题,我很困惑的方法是用漂亮的CSS显示所有flash消息(错误,成功,通知)。 也许答案已经在我的鼻子下的这篇文章中? rails – 设计 – 处理 – devise_error_messages 目前我的flash消息基于如何使用Twitter Bootstrap Rails gem定义Flash通知 这是我的例子: 在‘app / views / layouts / application.html.erb’中 ‘应用程序/视图/布局/ _messages.html.erb’ <div class="alert alert-“> × “flash_#{name}” %> 如何使用自定义css显示所有Flash消息(错误,成功,通知)? 更新:这篇文章显示了我正在尝试做的正确版本。 我遇到的问题是样式看起来不一样。 我相信这是因为html标签。 html = <<-HTML x #{sentence} #{messages} HTML 知道如何为警报设置相同的样式吗? 或者在CSS中使用什么标签? 您可以看到注册^^和登录(下方)页面之间的区别。 UPDATE2 我发了一篇关于我的问题的新post […]

在Ruby on Rails 3中使用Twitter Bootstrap图标作为链接的最佳方式?

使用Twitter Bootstrap提供的图标作为Rails 3中的链接的最佳方法是什么? 目前,我正在使用它像粘贴的代码段,但当我使用平板电脑查看网页时,图标不会显示。 我确信有更好的方法可以将Twitter Bootstrap Icons用作Rails 3上的链接。 mission.id), :method => :post) do %>

使用Rails 3中的Bootstrap为simple_form_for设置样式文件上传按钮

使用simple_form_for,Bootstrap和Rails 3.在一个表单中: 我不知道我如何设计这样,以便“选择文件”按钮可以有不同的类(’btn btn-primary’)。 此外,至少在使用Bootstrap时,默认情况下严重错位。 见附图。 最后,当没有添加文本时,如何将文本从“无文件选择”重新定义为“选择文件”,并在有文件名时显示文件名。

Rails 4 + bootstrap设置资产

我正在尝试使用bootstrap-sass在Rails4上设置bootstrap ,我收到了这个着名的错误: Sprockets::FileNotFound – couldn’t find file ‘bootstrap’ (in app/assets/javascripts/application.js:16): 我试过以下: application.js twitter/bootstrap gem ‘bootstrap-sass’, ‘~> 3.1.0’是组外资产 还尝试了一些互联网上的其他东西 我花了很多时间从其他post中提出不同的建议。 我如何系统地调试这个, 如何设置bootstrap-sass? ps:也试图让twitter-bootstrap-rails没有运气。 这是一些文件 的application.js //= require jquery //= require jquery_ujs //= require js-routes //= require bootstrap //= require_tree . //= require bootstrap-slider application.css.scss *= require jquery.ui.core *= require jquery.ui.theme *= require_self *= require bootstrap-slider *= […]

将一个Twitter Bootstrap按钮图标添加到Rails中的button_to

我正在使用Rails书进行敏捷Web开发,但我一直在使用Twitter Bootstrap而不是书中的自定义样式。 我无法通过GLyphonics向button_to方法添加图标。 我的代码如下所示: <%= button_to Add To Cart, line_items_path(product_id: product), class: “btn btn-success” %> 我尝试了很多变化,但似乎无法让它正常工作。

Rails:使用simple_form并集成Twitter Bootstrap

我正在尝试构建一个rails应用程序,而simple_form看起来是一个非常有用的gem。 问题是我使用twitter bootstrap css来做样式,而simple_form不允许你指定html的布局。 任何人都可以告诉我如何将simple_form html符合bootstrap css想要的格式?

will_paginate与无尽的滚动| Rails4

这是解决方案 所以我正在使用will_paginate / Bootstrap Will Paginate with Endless Scrolling。 为了让分页工作: 1.)在我的控制器中,我更新了我的索引操作 @clips = Clip.order(“created_at desc”).page(params[:page]).per_page(20) 2.)编辑我的索引视图: DONE 分页工作得很好。 To Add Endless scrolling我执行了与之前的Rails 3应用程序相同的步骤。 1.)编辑我的clips.js.coffee jQuery -> $(‘#clips-masonry’).imagesLoaded -> $(‘#clips-masonry’).masonry itemSelector: “.clips-masonry” # Thats my Masonry if $(‘.pagination’).length # Thats for the Endless Scrolling $(window).scroll -> url = $(‘.pagination .next_page a’).attr(‘href’) if url && $(window).scrollTop() > […]

当Twitter Bootstrap模式窗口包含Rails表单助手时显示错误

我问的是使用带有Rails表单助手的Twitter Bootstrap模式窗口并显示表单validation错误消息。 我正在使用Twitter Bootstrap 2.0和Rails 3.2。 我在Twitter Bootstrap模式窗口中有一个表单。 页面上有一个按钮,用于打开模态窗口并显示表单。 一切都很好,除非提交表单时出现错误,显示页面并且无法看到错误消息,因为表单位于(最初未显示的)模式窗口内。 我需要使用jQuery来测试表单是否包含Rails错误消息并覆盖“display:none;” 呈现页面时样式(或切换要显示的模态窗口)。 我已经尝试将以下代码添加到我的assets / javascripts / application.js文件中,但它不起作用: $(‘document’).ready(function() { if ($(‘#error_explanation’).length > 0) { $(“#request_invite”).css(“display”, “block”); } }) 并且: $(‘document’).ready(function() { if ($(‘#error_explanation’).length > 0) { $(“#request_invite”).modal(‘toggle’); } }) 当出现错误信息时,我需要做什么来显示模态窗口或将其打开? 这是在Twitter Bootstrap模式窗口(Haml)中显示表单的代码: #request-invite.modal{:style => “display: none;”} = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do […]

让application.css覆盖bootstrap

我正在尝试自定义我的rails应用程序导航栏并将css添加到application.css。 我知道application.css正在被正确引用,因为应用程序正在从中获取其他样式。 但导航栏css试图覆盖bootstrap.css中已有的内容,而应用程序无法识别它… application.html.erb(布局) “all” %> application.css body { padding-top: 20px; padding-bottom: 60px; } /* Custom container */ .container { margin: 0 auto; max-width: 1000px; } .container > hr { margin: 0px 0; } /* Main marketing message and sign up button */ .jumbotron { margin: 20px 0; text-align: center; } .jumbotron h1 { font-size: […]