2014-04-17 62 views
0

我試圖執行引導傳送帶,但顯示不正確。引導傳送帶無法正常顯示

這是我的頁面的樣子:

enter image description here

我的頁面/ home.html.erb如下:

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> 
    <!-- Indicators --> 
    <ol class="carousel-indicators"> 
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> 
    <li data-target="#carousel-example-generic" data-slide-to="1"></li> 
    <li data-target="#carousel-example-generic" data-slide-to="2"></li> 
    </ol> 

    <!-- Wrapper for slides --> 
    <div class="carousel-inner"> 
    <div class="item active"> 
     <img src="closeup.jpg" alt="Onemoretest" class="img-responsive"> 
     <div class="carousel-caption"> 
     1st photo 
     </div> 
    </div> 
    testing what this outputs 
    </div> 

    <div class="carousel-inner"> 
    <div class="item active"> 
     <img src="big1.jpg" alt="onemoretest2." class="img-responsive"> 
     <div class="carousel-caption"> 
     2nd photo 
     </div> 
    </div> 
    testing what this outputs2 
    </div> 

    <div class="carousel-inner"> 
    <div class="item active"> 
     <img src="big2.jpg" alt="..." class="img-responsive"> 
     <div class="carousel-caption"> 
     3rd photo 
     </div> 
    </div> 
    testing what this outputs3 
    </div> 

    <!-- Controls --> 
    <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> 
    <span class="glyphicon glyphicon-chevron-left"></span> 
    </a> 
    <a class="right carousel-control" href="#carousel-example-generic" data-slide="next"> 
    <span class="glyphicon glyphicon-chevron-right"></span> 
    </a> 
</div> 

<!-- Latest compiled and minified CSS --> 
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> 

<!-- Optional theme --> 
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> 

<!-- Latest compiled and minified JavaScript --> 
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> 

我缺少什麼?我不出來,很無奈

編輯:添加我的日誌

Started GET "/" for 127.0.0.1 at 2014-04-17 02:33:03 -0700 
Processing by PagesController#home as HTML 
    Rendered pages/home.html.erb within layouts/application (4.0ms) 
Completed 200 OK in 114ms (Views: 82.1ms | ActiveRecord: 0.0ms) 


Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-04-17 02:33:0 
4 -0700 


Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2014-04-17 02:33:04 
-0700 


Started GET "/closeup.jpg" for 127.0.0.1 at 2014-04-17 02:33:04 -0700 

ActionController::RoutingError (No route matches [GET] "/closeup.jpg"): 
    actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `c 
all' 
    actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca 
ll' 
    railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tag 
ged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.5.2) lib/rack/runtime.rb:17:in `call' 
    activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in ` 
call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call' 
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call' 
    railties (4.0.3) lib/rails/engine.rb:511:in `call' 
    railties (4.0.3) lib/rails/application.rb:97:in `call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    rack (1.5.2) lib/rack/content_length.rb:14:in `call' 
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `servi 
ce' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in 
start_thread' 


    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_route.html.erb (2.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_table.html.erb (12.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescu 
es/layout (64.0ms) 


Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2014-04-17 02:33:04 
-0700 


Started GET "/assets/pages.js?body=1" for 127.0.0.1 at 2014-04-17 02:33:04 -0700 



Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-04-17 02:33:04 
-0700 


Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-04-17 02:33:04 -070 
0 


Started GET "/assets/bootstrap" for 127.0.0.1 at 2014-04-17 02:33:04 -0700 


Started GET "/big1.jpg" for 127.0.0.1 at 2014-04-17 02:33:04 -0700 

ActionController::RoutingError (No route matches [GET] "/big1.jpg"): 
    actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `c 
all' 
    actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca 
ll' 
    railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tag 
ged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.5.2) lib/rack/runtime.rb:17:in `call' 
    activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in ` 
call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call' 
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call' 
    railties (4.0.3) lib/rails/engine.rb:511:in `call' 
    railties (4.0.3) lib/rails/application.rb:97:in `call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    rack (1.5.2) lib/rack/content_length.rb:14:in `call' 
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `servi 
ce' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in 
start_thread' 


    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_route.html.erb (2.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescu 
es/layout (109.1ms) 


Started GET "/big2.jpg" for 127.0.0.1 at 2014-04-17 02:33:04 -0700 

ActionController::RoutingError (No route matches [GET] "/big2.jpg"): 
    actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `c 
all' 
    actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca 
ll' 
    railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tag 
ged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.5.2) lib/rack/runtime.rb:17:in `call' 
    activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in ` 
call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call' 
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call' 
    railties (4.0.3) lib/rails/engine.rb:511:in `call' 
    railties (4.0.3) lib/rails/application.rb:97:in `call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    rack (1.5.2) lib/rack/content_length.rb:14:in `call' 
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `servi 
ce' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in 
start_thread' 


    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_route.html.erb (2.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_table.html.erb (2.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescu 
es/layout (53.0ms) 


Started GET "/closeup.jpg" for 127.0.0.1 at 2014-04-17 02:33:04 -0700 

ActionController::RoutingError (No route matches [GET] "/closeup.jpg"): 
    actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `c 
all' 
    actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca 
ll' 
    railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tag 
ged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged' 
    activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged' 
    railties (4.0.3) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.5.2) lib/rack/runtime.rb:17:in `call' 
    activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in ` 
call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call' 
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call' 
    railties (4.0.3) lib/rails/engine.rb:511:in `call' 
    railties (4.0.3) lib/rails/application.rb:97:in `call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    rack (1.5.2) lib/rack/content_length.rb:14:in `call' 
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `servi 
ce' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run' 
    c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in 
start_thread' 


    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_route.html.erb (1.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.0ms) 
    Rendered c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3 
/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescu 
es/layout (49.0ms) 

回答

1

問題是我包括<div class="carousel-inner">爲每個圖像塊。當它應該一次封裝所有三個。菜鳥的錯誤。

0

ABPrime就在這裏。您也可以在視圖中使用如下所示的行,以在Rails視圖中顯示圖像。

<img src=<%= asset_path('closeup.jpg') %>/>

鑑於您的圖片在app/assets/images/文件夾中。

+0

他的回答沒有奏效。我的圖像仍然顯示在其他下方...而不是滾動。 – user3408293

+0

這聽起來像是一個jQuery問題。確保你的html在[他們的網站]上(http://getbootstrap.com/javascript/#carousel)遵守表單(不是複製和粘貼),然後確保在你的視圖的底部你調用你的jQuery: '(文檔).ready(函數(){$('。carousel')。carousel();});' – Mike

+0

另外,將ABPrime的行稱爲'class =「活動項目」'爲'class =「item active」 – Mike