0
votes

When some image was not found (it's "src" attribute points to wrong path), i get following error:

Processing ApplicationController#index (for 127.0.0.1 at 2011-04-12 16:44:19) [GET]

ActionController::RoutingError (No route matches "non-existent-image.jpg" with {:method=>:get}): /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb:109:in debug_load' /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb:109:indebug_program' /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.9/bin/rdebug-ide:87 /usr/bin/rdebug-ide:19:in load' /usr/bin/rdebug-ide:19 -e:2:inload' -e:2

Rendering rescues/layout (not_found)

But, when there is a HTML5 video element, i don't see any complains of ActionController, when it is not found.

What's going on here ?

1

1 Answers

0
votes

It looks like you're generating HTML that looks like <img src="/non-existent-image.jpg"> and that path is not defined in your config/routes.rb so it can't be handled by the Rails application.

What you might be intending is:

<%= image_tag('non-existent-image.jpg') %>

This will generate a tag that looks like:

<img src="/images/non-existent-image.jpg">

So long as that file is present in your public/ folder, it should work.