lib/bivouac/template/static/not_found_controller.rb in bivouac-0.3.0 vs lib/bivouac/template/static/not_found_controller.rb in bivouac-0.4.0
- old
+ new
@@ -3,14 +3,18 @@
#
# Created using bivouac on <%= Time.now %>.
# Copyright (c) <%= Time.now.year %> __My__. All rights reserved.
#
-module <%= @conf.appname %>::Controllers
- class NotFound
- def get( path )
+module <%= @conf.appname %>
+ def r404(p=env.PATH)
+ puts p.gsub( /^\//, "" )
+ if File.exist?( File.join( filePath( __FILE__ ), '..', '..', 'public', p ) )
+ redirect "/public" << p
+ else
@status = 404
- @path = path
+ @path = p
render :not_found
end
end
end
+