-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.txt
30 lines (20 loc) · 962 Bytes
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
== File Type Icons
File icons you can use for attachments with Paperclip or Attachment Fu or... anything. I didn't create them, just converted them to pngs, resized them and added a couple common file types (.ai, .psd, .rb (of course)).
The original files can be found here:
http://www.iconiza.com/downloads/index.php
== License Information
The license is Creative Commons Attribution-ShareAlike 2.5. You can attribute the original creator:
Michael Müller C.
Web Designer and Developer
E-mail: mmuller@mmcdesign.com
E-mail: mullercardenas@gmail.com
Website: www.mmcdesign.com
Blog: blog.mmcdesign.com
== Use in Ruby on Rails
In Rails I put the following in a helper:
def icon_for(filename, options={})
ext = filename.match(/[.](\w{1,6})\Z/)[1]
size = "#{options[:size]}/" if options[:size]
"/file_icons/#{size ||=""}#{ext}.png"
end
Pass it a filename and it returns the path to the proper icon. It does not check to make sure the icon exists.