How to search for a speciel file extension

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

Ghazal M. 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
[email protected]

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!

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs