search for: mylastfile

Displaying 1 result from an estimated 1 matches for "mylastfile".

Did you mean: lastfile
2006 Jan 27
2
simple stuff in rails rhtml
...how to call it. I''m trying to get a list of files in a directory and it''s not obvious to me how to do this in Rails via a controller method. so ruby code is Dir.entries("testdir").last and html code is <%= Dir.entries("testdir").last %> or <% mylastfile= Dir.entries("testdir").last %> <%= mylastfile %> but how do I get this into the application controller (./app/controllers/application.rb) so I can say anywhere <%= mylastfile %> ? -- Posted via http://www.ruby-forum.com/.