2015-12-09 51 views
0

一切正常,但是當我去新的或編輯頁面時,佈局上的鏈接接收控制器的名稱之前,這使得圖像和鏈接不行。錯誤:控制器被添加到軌道上的URL紅寶石

示例:

/image/logo.jpg |當內部孩子/新| |變爲:孩子/圖像/ logo.jpg

home.hmtl成爲kidss/home.html的

rake routes 
     Prefix Verb URI Pattern     Controller#Action 
     kids GET /kids(.:format)    kids#index 
       POST /kids(.:format)    kids#create 
     new_kid GET /kids/new(.:format)   kids#new 
    edit_kid GET /kids/:id/edit(.:format) kids#edit 
      kid GET /kids/:id(.:format)   kids#show 
       PATCH /kids/:id(.:format)   kids#update 
       PUT /kids/:id(.:format)   kids#update 
       DELETE /kids/:id(.:format)   kids#destroy 
sponsor_index GET /sponsor(.:format)   sponsor#index 
       POST /sponsor(.:format)   sponsor#create 
    new_sponsor GET /sponsor/new(.:format)  sponsor#new 
edit_sponsor GET /sponsor/:id/edit(.:format) sponsor#edit 
     sponsor GET /sponsor/:id(.:format)  sponsor#show 
       PATCH /sponsor/:id(.:format)  sponsor#update 
       PUT /sponsor/:id(.:format)  sponsor#update 
       DELETE /sponsor/:id(.:format)  sponsor#destroy 

如何解決這個任何想法? 我是紅寶石新手,我無法在任何地方找到答案。

這是我得到的運行服務器時:

Started GET "/kids/new" for ::1 at 2015-12-09 17:21:57 -0700 
    ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" 
Processing by KidsController#new as HTML 
    Rendered kids/_form.html.erb (36.0ms) 
    Rendered kids/new.html.erb within layouts/internas (65.0ms) 
Completed 200 OK in 426ms (Views: 402.0ms | ActiveRecord: 0.0ms) 


Started GET "/kids/img/logoverde.png" for ::1 at 2015-12-09 17:21:58 -0700 

ActionController::RoutingError (No route matches [GET] "/kids/img/logoverde.png"): 
    actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    web-console (2.2.1) lib/web_console/middleware.rb:39:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' 
    rack (1.6.4) lib/rack/runtime.rb:18:in `call' 
    activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/static.rb:116:in `call' 
    rack (1.6.4) lib/rack/sendfile.rb:113:in `call' 
    railties (4.2.5) lib/rails/engine.rb:518:in `call' 
    railties (4.2.5) lib/rails/application.rb:165:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    rack (1.6.4) lib/rack/content_length.rb:15:in `call' 
    rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' 


    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_trace. 
html.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_route.h 
tml.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_table.h 
tml.erb (4.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_reques 
t_and_response.html.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/routing 
_error.html.erb within rescues/layout (1349.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.er 
b within layouts/inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb w 
ithin layouts/inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/ 
inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts 
/javascript (1024.7ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/ja 
vascript (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layo 
uts/javascript (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (2317.6ms) 


Started GET "/assets/application.self-105c700c87c919bec5418f6c6f8dc61317ea50918c4bc25a71d70bb3172ba0c8.css?body=1" for 
::1 at 2015-12-09 17:22:03 -0700 


Started GET "/kids/js/scripts.js" for ::1 at 2015-12-09 17:22:03 -0700 

ActionController::RoutingError (No route matches [GET] "/kids/js/scripts.js"): 
    actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    web-console (2.2.1) lib/web_console/middleware.rb:39:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' 
    rack (1.6.4) lib/rack/runtime.rb:18:in `call' 
    activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/static.rb:116:in `call' 
    rack (1.6.4) lib/rack/sendfile.rb:113:in `call' 
    railties (4.2.5) lib/rails/engine.rb:518:in `call' 
    railties (4.2.5) lib/rails/application.rb:165:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    rack (1.6.4) lib/rack/content_length.rb:15:in `call' 
    rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' 


    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_trace. 
html.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_route.h 
tml.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_table.h 
tml.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_reques 
t_and_response.html.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/routing 
_error.html.erb within rescues/layout (1474.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.er 
b within layouts/inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb w 
ithin layouts/inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/ 
inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts 
/javascript (897.2ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/ja 
vascript (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layo 
uts/javascript (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (2102.0ms) 


Started GET "/kids/js/parallax.js" for ::1 at 2015-12-09 17:22:07 -0700 

ActionController::RoutingError (No route matches [GET] "/kids/js/parallax.js"): 
    actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    web-console (2.2.1) lib/web_console/middleware.rb:39:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' 
    rack (1.6.4) lib/rack/runtime.rb:18:in `call' 
    activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/static.rb:116:in `call' 
    rack (1.6.4) lib/rack/sendfile.rb:113:in `call' 
    railties (4.2.5) lib/rails/engine.rb:518:in `call' 
    railties (4.2.5) lib/rails/application.rb:165:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    rack (1.6.4) lib/rack/content_length.rb:15:in `call' 
    rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' 


    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_trace. 
html.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_route.h 
tml.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_table.h 
tml.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_reques 
t_and_response.html.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/routing 
_error.html.erb within rescues/layout (1405.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.er 
b within layouts/inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb w 
ithin layouts/inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/ 
inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts 
/javascript (906.6ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/ja 
vascript (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layo 
uts/javascript (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (2111.5ms) 


Started GET "/images/default_profile.png" for ::1 at 2015-12-09 17:22:11 -0700 

ActionController::RoutingError (No route matches [GET] "/images/default_profile.png"): 
    actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    web-console (2.2.1) lib/web_console/middleware.rb:39:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' 
    rack (1.6.4) lib/rack/runtime.rb:18:in `call' 
    activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/static.rb:116:in `call' 
    rack (1.6.4) lib/rack/sendfile.rb:113:in `call' 
    railties (4.2.5) lib/rails/engine.rb:518:in `call' 
    railties (4.2.5) lib/rails/application.rb:165:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    rack (1.6.4) lib/rack/content_length.rb:15:in `call' 
    rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' 


    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_trace. 
html.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_route.h 
tml.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_table.h 
tml.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_reques 
t_and_response.html.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/routing 
_error.html.erb within rescues/layout (1451.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.er 
b within layouts/inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb w 
ithin layouts/inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/ 
inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts 
/javascript (908.6ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/ja 
vascript (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layo 
uts/javascript (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (2073.5ms) 


Started GET "/kids/img/logobranco.png" for ::1 at 2015-12-09 17:22:15 -0700 

ActionController::RoutingError (No route matches [GET] "/kids/img/logobranco.png"): 
    actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    web-console (2.2.1) lib/web_console/middleware.rb:39:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' 
    rack (1.6.4) lib/rack/runtime.rb:18:in `call' 
    activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/static.rb:116:in `call' 
    rack (1.6.4) lib/rack/sendfile.rb:113:in `call' 
    railties (4.2.5) lib/rails/engine.rb:518:in `call' 
    railties (4.2.5) lib/rails/application.rb:165:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    rack (1.6.4) lib/rack/content_length.rb:15:in `call' 
    rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' 


    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_trace. 
html.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_route.h 
tml.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_table.h 
tml.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_reques 
t_and_response.html.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/routing 
_error.html.erb within rescues/layout (1386.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.er 
b within layouts/inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb w 
ithin layouts/inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/ 
inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts 
/javascript (938.7ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/ja 
vascript (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layo 
uts/javascript (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (2289.6ms) 


Started GET "/kids/img/logoverde.png" for ::1 at 2015-12-09 17:22:20 -0700 

ActionController::RoutingError (No route matches [GET] "/kids/img/logoverde.png"): 
    actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    web-console (2.2.1) lib/web_console/middleware.rb:39:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.2.5) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' 
    rack (1.6.4) lib/rack/runtime.rb:18:in `call' 
    activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    actionpack (4.2.5) lib/action_dispatch/middleware/static.rb:116:in `call' 
    rack (1.6.4) lib/rack/sendfile.rb:113:in `call' 
    railties (4.2.5) lib/rails/engine.rb:518:in `call' 
    railties (4.2.5) lib/rails/application.rb:165:in `call' 
    rack (1.6.4) lib/rack/lock.rb:17:in `call' 
    rack (1.6.4) lib/rack/content_length.rb:15:in `call' 
    rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' 
    c:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' 


    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_trace. 
html.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_route.h 
tml.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/routes/_table.h 
tml.erb (2.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_reques 
t_and_response.html.erb (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/routing 
_error.html.erb within rescues/layout (1359.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.er 
b within layouts/inlined_string (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb w 
ithin layouts/inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/ 
inlined_string (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts 
/javascript (974.7ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/ja 
vascript (0.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layo 
uts/javascript (1.0ms) 
    Rendered c:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (2223.6ms) 

當它說:

Started GET "/kids/img/logoverde.png" for ::1 

我應該/img/logoverde.png,無控制器「孩子的名字「 而圖像是在佈局內部,而不是在視圖內部。

的形象是你在你的代碼中使用相對路徑導航DIV

<nav> 

        <div class="nav-bar text-center"> 
         <div class="col-md-2 col-md-push-5 col-sm-12 text-center"> 
          <a href="index.html" target="_self"> 
           <img alt="logo" class="image-xxs" src="img/logoverde.png"> 
          </a> 
         </div> 
+0

極品另外:添加的代碼片段與影像 – CannyFoxx

回答

1

內。您的瀏覽器搜索此圖像不總是在domain.com/img/logoverde.png。然後你要去domain.com/kids/1,瀏覽器試圖從domain.com/kids/img/logoverde.png加載圖片。

必須使用絕對路徑(剛加入URI路徑前斜線):

<img alt="logo" class="image-xxs" src="/img/logoverde.png"> 

在軌存在一種更好的方式 - 上傳圖片app/assets/images目錄和使用Assets Pipeline添加圖片頁面。例如,(如果你保存在logo.pngapp/assets/images/):

<%= image_tag "logo.png" %> 
+0

你能解釋一下這是什麼呢? – Allan

+0

它將'app/assets/images /'目錄中的圖像添加到您的頁面(例如'somedir/kids.png')。但是我需要更多關於你的代碼的信息。把一部分,你添加圖像到頁面 – CannyFoxx

+0

我編輯帖子。圖像和鏈接在版面上。他們不應該改變網址。 – Allan