lib/rasti/web/render.rb in rasti-web-0.0.1 vs lib/rasti/web/render.rb in rasti-web-0.0.2
- old
+ new
@@ -38,9 +38,18 @@
respond_with extract_status(args),
extract_headers(args).merge('Content-Type' => 'application/javascript'),
script
end
+ def file(filename, *args)
+ content_type = MIME::Types.of(filename).first.content_type
+ body = File.read filename
+
+ respond_with extract_status(args),
+ extract_headers(args).merge('Content-Type' => content_type),
+ body
+ end
+
def partial(template, locals={})
response['Content-Type'] = 'text/html'
response.write view_context.render(template, locals)
end
\ No newline at end of file