Permalink
Browse files

added fallback example in readme

  • Loading branch information...
1 parent a8269e3 commit 831d2a50de0befe6338ff0b558bcd1ae0afa0d47 @kristianmandrup committed Aug 16, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 README.md
View
@@ -32,6 +32,8 @@ The above can be rendered in Rails 3+ by writing the following code, using the V
= picture_src 'medium_x2.jpg', "(min-width: 400px) and (min-device-pixel-ratio: 2.0)"
= picture_src 'largs.jpg', "(min-width: 800px)"
= picture_src 'large_x2.jpg', "(min-width: 800px) and (min-device-pixel-ratio: 2.0)"
+ # ...
+ = picture_fallback "external/imgs/small.jpg", alt: "A giant stone face at The Bayon temple in Angkor Thom, Cambodia"
```
Note: This example uses [HAML](https://github.com/haml/haml) as the rendering engine.
@@ -45,6 +47,8 @@ Using conventions, and an extra `ratio:` option, the following shorthand is poss
= picture_src 'small.jpg', ratio: 'x2'
= picture_src 'medium.jpg', "400", ratio: 'x2'
= picture_src 'large.jpg', "800", ratio: 'x2'
+ # ...
+ = picture_fallback "external/imgs/small.jpg", alt: "A giant stone face at The Bayon temple in Angkor Thom, Cambodia"
```
This will ouput exactly the same HTML as the previous example :)

0 comments on commit 831d2a5

Please sign in to comment.