0

My rails app uses a route called "four_oh_four" to provide a custom 404 page that uses the site's application layout to look nice.

I've started receiving the following errors:

Missing template info/four_oh_four with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>["image/jpeg", "image/pjpeg", "image/png", "image/gif"], :locale=>[:en, :en]} 

I can't seem to figure out what I need to be doing to resolve this. Any ideas?

Here's what the controller looks like (nothing, really):

def four_oh_four
end

And here's the routes.rb:

match 'four_oh_four' => 'info#four_oh_four', :as => :four_oh_four
...
# Catch 404s
match '*path' => 'info#four_oh_four', :status => 404
isthmuses
  • 1,316
  • 1
  • 17
  • 27

1 Answers1

0

You can check if there is a file named "four_oh_four.html.erb" in your info dir. It could be mistyping error . Usually the 404 page is located in /public .

R Milushev
  • 4,295
  • 3
  • 27
  • 35
  • The file is there, and it works fine for normal 404s...in this case it looks like the problem is that it's throwing a 404 for an image rather than a page, and doesn't seem to be handling that correctly. Any idea how I can get these formats (e.g., "image/jpeg") working too? – isthmuses Dec 06 '12 at 00:31