Tag: twitter bootstrap

turbolinks与bootstrap模式的问题

我做这样的模态: 显示模态的链接: true), ‘data-toggle’ => ‘modal’, ‘data-target’ => ‘#myModal’, ‘data-no-turbolink’ => true %> 模态html本身: Fechar 但是, data-no-turbolink按预期工作。 如果我刷新页面,它可以正常工作,但是,当我使用turbolinks浏览页面时,看起来像data-no-turbolink只是被忽略。 难道我做错了什么? 我有一些模态,如我的应用程序中的示例,不想删除它们,也不想删除turbolinks … 提前致谢。

Rails link_to带有样式glyphicon的标记标记

我正在尝试使用我在rails应用程序中设置样式的字形图标。 我想让图标成为另一个页面的链接,但不能使用标准的引导程序样式,因为我已经为我的页面样式定制了链接。 我一直收到关键字类错误 – 有谁知道为什么? 谢谢。 我的观点中有以下链接: <%= link_to , page_path(‘messages’) %> 我也有css如下: span.glyphicon-comment { vertical-align:middle; margin:auto; padding:10px; font-size: 2em; text-align: right; a:link {text-decoration:none; background-color:transparent; color:grey;}; a:visited {text-decoration:none;background-color:transparent; color:grey;}; a:hover {text-decoration:none;background-color:transparent; color:dark grey;}; a:active {text-decoration:none;background-color:transparent; color:grey;}; }

通过twitter-bootstrap-rails gem升级到bootstrap 2.0.1后,Heroku部署失败

更新: 在git push heroku master显示此错误: —–> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! couldn’t find file ‘twitter/bootstrap’ (in /tmp/build_2pmsvze33th3e/app/assets/javascripts/application.js:9) Tasks: TOP => assets:precompile:primary (See full trace by running task with –trace) Precompiling assets failed, enabling runtime asset compilation Injecting rails31_enable_runtime_asset_compilation Please see this article for troubleshooting help: http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting 我按照本指南将Bootstrap 2布局升级到2.0.1。 之后,我将这个错误发送到了Heroku: […]

如何更改默认的rails错误div“field_with_errors”

我正在使用巫术进行身份validation以及twitter bootstrap 。 我想通过改变添加到DOM的默认rails 来以twitter的bootstrap样式在我的注册表单上设置我的错误消息。 做这样的事情的轨道惯例是什么? 我想你可以添加一些操作DOM的javascript来重命名 ,但这看起来像是一个黑客。 似乎应该有一种方法可以在rails中覆盖它,但我无法弄清楚在哪里这样做。 这就是bootstrap要求您标记错误以使用其内置表单错误样式的方式: Input with error Please correct the error

从wrapbootstrap实现bootstrap主题

我已经通过wrapbootstrap下载了一个主题,但无法弄清楚如何实现它。 我假设它只是复制CSS和JS文件,但似乎还有更多。 我下载的主题是https://wrapbootstrap.com/theme/awesome-admin-WB0663265 我已经暂时将它上传到Github这里github.com/raycchan/temp (一旦我解决它,我会尽快删除它) 这里有一些示例模板,其中包含生成的.html文件以及.html.erb文件,一旦我将erb文件插入我的rails应用程序,它就会抛出如下错误: 但它不承认这些: # data undefined # partial undefined 有人可以一步一步地指导我如何实现这个bootstrap主题? 谢谢

Twitter Bootstrap模式rails删除按钮不起作用

我转而使用Twitter Bootstrap 2.1.1。 我有一个模式有一个删除按钮,但它不起作用。 在以前的bootstrap版本中它运行正常。 Rails版本是3.1 这是代码 <a title="” id=”delete” class=”label” href=”#myModal-” data-toggle=”modal”> 模态 <div class="modal hide" id="myModal-” tabindex=”-1″ role=”dialog” aria-labelledby=”myModalLabel” aria-hidden=”true”> × ‘posts’, :action => ‘destroy’, :id => post.id } ,:method => :delete, :class => ‘btn btn-primary’) %> 但它不起作用。 Rails接收GET并显示post,但它不会破坏它。 任何的想法? 谢谢

Twitter Bootstrap Modal没有弹出用户登录

当用户登陆我们的主页时,我无法将twitter引导弹出模式与设计登录/注册结合使用。 我花了一些时间实现不同的方法,但仍然没有成功。 截至目前,当我点击与模态相关联的“登录”按钮时,网站刷新但没有模态。 apps / views / layout / _header.html.slim(我的application.erb文件调用其他部分) li = link_to “Login”, “data-toggle” => “modal”, “data-target” => “#login_modal”, :class => “btn btn-small” li = link_to “Sign Up Free”, “data-toggle” => “modal”, “data-target” => “#sign_up_modal”, :class => “btn btn-small” 我有两个部分(sign_up_modal,login_modal)几乎相同… x Sign Up resource_name, :url => registration_path(resource_name)) do |f| %> true %> ‘btn btn-small […]

Rails和bootstrap – 将HTML标记添加到提交按钮文本

我有一个使用ajax的like /不同按钮的表单: = form_for like, :html => { :method => :delete}, :remote => true do |f| = f.submit pluralize(@video.likes.count, ‘like’), :class => “btn btn-warning btn-mini”, “data-disable-with”=> “Just a moment…” 表格完美无缺。 我想在提交按钮的文本前面添加一个图标。 添加图标的haml代码如下(twitter bootstrap): %i.icon-heart.icon-white 有没有办法将这个HTML添加到按钮? 我尝试将其添加为纯HTML,但rails将其呈现为文本。 UPDATE 我已经设法将提交按钮封装在包含图标和相应样式的span类中。 我现在需要删除按钮上的每个样式…… %span.btn.btn-danger.btn-mini %i.icon-heart.icon-white = f.submit pluralize(@video.likes.count, ‘like’)

Rails栏杆gem错误“未定义方法:’少’”

我刚刚用gem update和bundle update更新了我的rails app的gem。 当我尝试用rails s测试它时,它给了我这个错误: /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/railtie/configuration.rb:85:in method_missing’:undefined method /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/railtie/configuration.rb:85:in less’ for # (NoMethodError) 其余的错误消息如下: from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/twitter-bootstrap-rails-2.1.6/lib/twitter/bootstrap/rails/engine.rb:15:in `block in ‘ from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec’ from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run’ from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers’ from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each’ from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers’ from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!’ from /Users/Richard/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing’ from /Users/Richard/Code/Rails/rgsimms/config/environment.rb:5:in `’ from /Users/Richard/Code/Rails/rgsimms/config.ru:4:in `require’ from /Users/Richard/Code/Rails/rgsimms/config.ru:4:in `block in ‘ from […]

资产管道未定义变量SASS

我一直在尝试使用http://startbootstrap.com/stylish-portfolio并在下载所有文件并复制到目录后,我在部分_bordered-pull上收到以下错误: ActionView::Template::Error (Undefined variable: “$fa-css-prefix”. 但是,变量已定义,我正在导入(或至少尝试)部分变量。 我的资产/样式表目录如下: –application.css.scss –bootstrap.css.scss –font-awesome.css.scss.erb –stylish-portfolio.css.scss –|font-awesome –_bordered-pulled.css.scss –…(other partials) –font-awesome.css.scss Application.css.scss: /* * This is a manifest file that’ll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, […]