No commit activity in last 3 years
No release in over 3 years
Rails gem to add random Giphy images into your HTML. A silly gem with no specific purpose.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
 Project Readme

Gem Version

About

RandomGiphyImageRails is an absolute silly gem with the only purpose of put some random Giphy images on your HTML.

Installation

Add this line to your application's Gemfile:

gem 'random_giphy_image_rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install random_giphy_image_rails

Usage

After install the gem, the only thing you should do in your Rails application is add some lines into your assets files. Add this into your application.js file:

  //= require random_giphy_image_rails

and this line into you application.css file:

  *= require random_giphy_image_rails

Now you're ready to put Giphy images on your site. You only have to do something like this on your JS:

$(document).ready(function(){
  // Set debug mode (for console logs)
  RandomGiphyImageRails.debug = true;

  // Testing api key by default if you don't specify one
  RandomGiphyImageRails.data.api_key = 'YOUR_GIPHY_API_KEY';

  // Class of the HTML element where you want to put the gif
  RandomGiphyImageRails.data.element_class = 'giphyme';

  // Query or tag of your random gif
  RandomGiphyImageRails.data.query = 'nintendo';

  // Executes the random gif thing
  RandomGiphyImageRails.giphyme();
});

And then put one or more HTML elements in your view:

<body>
  <div class="giphyme"> </div>
</body>

Refresh you page and... voila! :)

Important: this gem uses jQuery to work.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dreamingechoes/random_giphy_image_rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.