0.0
No commit activity in last 3 years
No release in over 3 years
https://github.com/petethepig/emoji4rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 3.0.9
 Project Readme

#emoji4rails

Emoji4rails brings Emoji support for you Rails apps.

##Installing Install gem:

gem install emoji4rails

or edit your Gemfile:

gem 'emoji4rails'

and run:

bundle install

##Basics

You are going to use just one simple helper:

render_emoji ( text, options = { :class => 'emoji' } )
  • text – text with Emojis
  • options – hash of HTML attributes

Such thing

render_emoji ( ':bear:', { :style => 'width:20px;' } )

will be rendered as:

<img src='/assets/emojis/bear.png' style='width:20px;' />

##Usage ###In Views The helper is automatically included into ActionView::Base so just call:

<%= raw render_emoji('Text, containing emojis :mouse:') %>

###In Models, Controllers, etc Include Emoji4Rails::Helpers to your class:

require "emoji4rails/helpers"

class MyClass
  include Emoji4Rails::Helpers
  def render_page html_content
    render_emoji html_content
  end
end

###Found a Bug? Having Troubles?

Please, let me know

###Thanks To These guys, I borrowed the images from this repo. ###LISENCE MIT License. Copyright 2012 Dmitry Filimonov.