Brings Emoji support to your Rails apps
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test/test-app
vendor
.DS_Store
.gitignore
Gemfile
MIT-LICENSE
README.md
emoji4rails.gemspec

README.md

#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.