twitter-bootstrap-rails

Dynamically add active class to bootstrap li in Rails

狂风中的少年 提交于 2019-11-27 18:01:32
in the bootstrap navigation bar. You can get the effect of a button being clicked by adding the class active . Naturally, I want to use this on my pages. For example if I'm on the about us page I want the about us button clicked. What is the best way to go about this? I was going to go to each page and at the bottom have a jQuery function add the class active to it. Is there a better way? Read about current_page? here You can add a method for handle logic with current_page? , example a method : module ApplicationHelper def active_class(link_path) current_page?(link_path) ? "active" : "" end

How to integrate a Wrap Bootstrap theme into an Rails application?

↘锁芯ラ 提交于 2019-11-27 10:30:30
I have bought a twitter bootstrap theme from wrapbootstrap . I already have a functional rails application. Now, I want to design my application by integrating the bootstrap theme into my application. I am new to this and I have no idea how to do it. After doing a lot of research on this, I found only a very few discussion regarding this issue. As for example I found this post: Implementing WrapBootstrap theme into Rails App But, I am not totally sure how the assets from the theme will be applied to my application. I have copied all the assets under my project's app/assets/images , app/assets

Dynamically add active class to bootstrap li in Rails

不羁岁月 提交于 2019-11-27 04:14:36
问题 in the bootstrap navigation bar. You can get the effect of a button being clicked by adding the class active . Naturally, I want to use this on my pages. For example if I'm on the about us page I want the about us button clicked. What is the best way to go about this? I was going to go to each page and at the bottom have a jQuery function add the class active to it. Is there a better way? 回答1: Read about current_page? here You can add a method for handle logic with current_page? , example a

Font-awesome, input type 'submit'

こ雲淡風輕ζ 提交于 2019-11-26 21:21:12
There seems to be no class for input type 'submit' in font-awesome. Is it possible to use some class from font-awesome for button input? I've added icons to all buttons (which actually links with class 'btn' from twitter-bootstrap) in my applications, but can't add icons on 'input type submit'. Or, how to use this code: input#image-button{ background: #ccc url('icon.png') no-repeat top left; padding-left: 16px; height: 16px; } html: <input type="submit" id="image-button">Text</input> (which I took from HTML: How to make a submit button with text + image in it? ) with font-awesome? use button

Bootstrap 3+Rails 4 - Certain Glyphicons not working

自古美人都是妖i 提交于 2019-11-26 05:27:03
问题 I am trying to use bootstrap 3 in my rails 4 app. Followed this tutorial to set up bootstrap 3 using bootstrap saas from this github page. Bootstrap is working fine but glyphicons are not working as expected. Certain glyphicons are not displaying at all. For e.g. I tired to display a few of them for testing in my application.html.erb: glyphicon glyphicon-floppy-disk -> <span class=\"glyphicon glyphicon-floppy-disk\"></span> </br> glyphicon glyphicon-plus -> <span class=\"glyphicon glyphicon