[Rails] Log Files in View

Norman Timmler lists at inlet-media.de
Wed Mar 1 09:27:27 GMT 2006


Am Dienstag, den 28.02.2006, 21:34 +0100 schrieb Alex MacCaw:
> Is it possible to display the log files in the view?
> Thanks in advance.

Rails views are ERB files and inside you can do anything what is doable
with ruby.

If you want to display the current log file for example:

<%= File.open("#{RAILS_ROOT}/log/#{RAILS_ENV}.log") { |f| f.read } %>

-- 
Norman Timmler

http://blog.inlet-media.de



More information about the Rails mailing list