rails 4:无法将bootstrap主题导入rails

时间:2014-09-13 18:34:00

标签: html css ruby-on-rails ruby twitter-bootstrap

尝试将名为landon的bootsrap主题导入到我的rails应用程序中,但无法使CSS文件生效。 安装了bootstrap gem(bootstrap-sass 3.1.1.1)创建了一个css.scss
&安培;添加了行@import 'bootstrap';

将html代码复制并粘贴到home.html.erb中,所以当我运行网络应用程序时,我得到的文字很酷

所以到样式我有2个文件main.css和bootstrap.css文件 不确定我是否需要复制bootstrap.css文件,因为我有自举宝石。

所以已将main.css复制到css.scss文件

还添加了// =还需要bootstrap到javascript文件

home.html.erb

<body>
    <div class="preloader"></div>

    <! -- ******************** MASTHEAD SECTION ******************** -->    
    <main id="top" class="masthead" role="main">
        <div class="container">
            <div class="logo"> 
                    <!-- <a href="index.html#"><img src="images/logo.png" alt="logo"></a> -->
                    <a href="index.html#"></a>
            </div>

            <h1>Helping <strong>Mum's</strong><br>
            make better choices with their <strong>kids</strong></h1>

            <div class="row">
                <div class="col-md-6 col-sm-12 col-md-offset-3 subscribe">
                    <div class="indicates-required" style="display:none;"><span class="asterisk">*</span> indicates required</div>
                    <form action="//ubiquate.us6.list-manage.com/subscribe/post?u=bb0f5fdb70a640208cb0ecaa8&amp;id=16a7a49314" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
                    <!-- <form class="form-horizontal" role="form" action="subscribe.php" id="subscribeForm" method="POST"> -->
                        <div class="form-group">
                            <div class="col-md-7 col-sm-6 col-sm-offset-1 col-md-offset-0">
                                <input class="form-control input-md required email" value="" name="EMAIL" type="email" id="address mce-EMAIL" placeholder="Enter your email" data-validate="validate(required, email)" required="required">
                            </div>
                                <div id="mce-responses" class="clear">
                                    <div class="response" id="mce-error-response" style="display:none"></div>
                                    <div class="response" id="mce-success-response" style="display:none"></div>
                                </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
                            <div class="col-md-5 col-sm-4">
                                <div style="position: absolute; left: -5000px;"><input type="text" name="b_bb0f5fdb70a640208cb0ecaa8_16a7a49314" tabindex="-1" value=""></div>
                                <div class="clear"><button type="submit" id="mc-embedded-subscribe" class="btn btn-success btn-lg">GET EARLY ACCESS</button>
                            </div>
                        </div>
                    </form>
                    <span id="result" class="alertMsg"></span> </div>
                </div>

                <a href="index.html#explore" class="scrollto">
                <p>SCROLL DOWN TO EXPLORE</p>
                <p class="scrollto--arrow"><img src="images/scroll_down.png" alt="scroll down arrow"></p>
                </a>
        </div><! --/container -->
    </main><! --/main -->


        <! -- ******************** TESTIMONIALS SECTION ******************** -->     
        <div class="highlight testimonials">
            <div class="container">
                <div class="section-title">
                    <h2>What our customers said</h2>
                    <h4>Don't take our word. See our testimonials </h4>
                </div>

                <section class="row breath">
                    <div class="col-md-6">
                        <div class="testblock">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </div>
                        <div class="clientblock"> 
                            <img src="images/customer-img-1.jpg" alt=".">
                            <p><strong>John Doe</strong> <br>
                                Founder of <a href="index.html#">Blacktie.co</a>
                            </p>
                        </div>
                    </div><! --/col-md-6 -->

                    <div class="col-md-6">
                        <div class="testblock">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </div>
                        <div class="clientblock"> 
                            <img src="images/customer-img-2.jpg" alt=".">
                            <p><strong>Richard Sommer</strong> <br>
                                CEO of <a href="index.html#">Blacktie.co</a>
                            </p>
                        </div>
                    </div><! --/col-md-6 -->
                </section><! --/section -->

            </div><! --/container -->
        </div><! --/highlight Testimonials -->


        <! -- ******************** FOOTER ******************** -->    
        <main class="footercta" role="main">
            <div class="container">
                <h1>The Most Simple & <strong>Powerful Way</strong> <br>
                    to <strong>launch</strong> your product</h1>

                <div class="row">
                    <div class="col-md-12 breath text-center"> 
                        <a href="index.html#top" class="btn btn-success btn-lg gototop">GET EARLY ACCESS</a> 
                    </div>
                </div>
            </div><! --/container -->
        </main><! --/main -->

        <div class="container">
            <section class="row breath">
                <div class="col-md-12 footerlinks">
                    <p>&copy; 2014 FoodBuddy. All Rights Reserved</p>
                </div>
            </section><! --/section -->
        </div><! --/container -->




<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/easing.js"></script>
<script src="js/nicescroll.js"></script>

<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);
</script>


<script>


 $(function() {
    $('.scrollto, .gototop').bind('click',function(event){
         var $anchor = $(this);
         $('html, body').stop().animate({
         scrollTop: $($anchor.attr('href')).offset().top
          }, 1500,'easeInOutExpo');
     event.preventDefault();
      });
  });


</script>

</body>

1 个答案:

答案 0 :(得分:0)

如此处https://github.com/twbs/bootstrap-sass所述,要实现引导主题,您必须将其包括在内:@import "bootstrap/theme";用于位于./bootstrap/_theme.scss的主题。不确定,因为我不知道你的设置,但你可以尝试一下。