hi i want to show just the powerpoint file among diffenet kind of file i uploaded. how can i do it? my model is mugshot for mugshot in @mugshot if .... thanks alot -- Posted via http://www.ruby-forum.com/.
Ghazal Mir wrote:> hi > i want to show just the powerpoint file among diffenet kind of file i > uploaded. > how can i do it?Filter for .ppt files. If you don''t know how to do that, I strongly suggest reading some basic Ruby and Rails docs: you''ve been posting the sort of questions that imply that you don''t yet understand the basics of your development platform. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> > > Filter for .ppt files. If you don''t know how to do that, I strongly > suggest reading some basic Ruby and Rails docs: you''ve been posting the > sort of questions that imply that you don''t yet understand the basics of > your development platform. > >i just havent faced to it''s syntax in any docs yet! -- Posted via http://www.ruby-forum.com/.
Hi You will get filenames with extension .ppt from a folder and its subfolders like files = [] Dir.glob(''**/*'').each do | file | files << file.downcase if file.downcase =~ /([^\s]+(?=\.(ppt))\.\2)/ end Sijo -- Posted via http://www.ruby-forum.com/.