File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
- # Rails::File::Icons
1
+ Rails File Icons
2
+ ---
2
3
3
- TODO: Write a gem description
4
+ Simple file icons that use the Rails Asset Pipeline.
4
5
5
6
## Installation
6
7
@@ -18,7 +19,17 @@ Or install it yourself as:
18
19
19
20
## Usage
20
21
21
- TODO: Write usage instructions here
22
+ Render a file icon for a given filename in a view.
23
+
24
+ <%= image_tag Icon.for_filename('myfile.jpg') %>
25
+
26
+ Get the image path for a given file extension. (leading dot is irrelevant)
27
+
28
+ Icon.for_ext '.jpg'
29
+ > 'fileicons/file_extension_jpg.png'
30
+
31
+ Icon.for_ext 'gif'
32
+ > 'fileicons/file_extension_gif.png'
22
33
23
34
## Contributing
24
35
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ module Icon
14
14
known_extensions
15
15
end
16
16
17
-
18
-
19
17
def self . for_filename filename
20
18
for_ext File . extname ( filename )
21
19
end
You can’t perform that action at this time.
0 commit comments