Skip to content

Commit 5deb822

Browse files
committed
Update README
1 parent c1d6b9a commit 5deb822

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Rails::File::Icons
1+
Rails File Icons
2+
---
23

3-
TODO: Write a gem description
4+
Simple file icons that use the Rails Asset Pipeline.
45

56
## Installation
67

@@ -18,7 +19,17 @@ Or install it yourself as:
1819

1920
## Usage
2021

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'
2233

2334
## Contributing
2435

lib/rails-file-icons.rb

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ module Icon
1414
known_extensions
1515
end
1616

17-
18-
1917
def self.for_filename filename
2018
for_ext File.extname(filename)
2119
end

0 commit comments

Comments
 (0)