Simple picture_tag helper, which can show various image formats based on browser support
About The Project
Provide a new helper method to Rails views -
It generates a
<picture> HTML tag and within it places HTML tag as
<img> and any other available image formats as
Internally it uses Rails built-in method
Add this line to your application's Gemfile:
And then execute in terminal:
Put multiple same-named images with different file formats into
Place following code into any Rails view. It takes the same options as Rails built in
Note - do not input file extension in filename
See the TODO for status of current development.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature)
- Commit your Changes (
git commit -m 'Add some AmazingFeature')
- Push to the Branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
After checking out the repo, run
bin/setup to install dependencies. Then, run
bundle exec rake to run the tests, rubocop. You can also run
bin/console for an interactive prompt that will allow you to experiment.
The gem is available as open source under the terms of the MIT License.
Project Link: https://github.com/OskarsEzerins/rails_picture
Everyone interacting in the rails_picture project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.