Sha256: d4248682cf3f11ad67e60dcea3a0fb8f9a020317d161a9cd2d615b201945f363

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

#emoji4rails

Emoji4rails brings **Emoji** support for you **Rails** apps.

##Installing
Install gem:
```bash
gem install emoji4rails
```

or edit your Gemfile:

```ruby
gem 'emoji4rails'
```
and run:
```bash
bundle install
```

##Basics

You are going to use just one simple helper:
```ruby
render_emoji ( text, options = { :class => 'emoji' } )
```
* **text** – text with Emojis 
* **options** – hash of HTML attributes


Such thing
```ruby
render_emoji ( ':bear:', { :style => 'width:20px;' } )
```
will be rendered as:
```html
<img src='/assets/emojis/bear.png' style='width:20px;' />
```

##Usage
###In Views
The helper is automatically included into `ActionView::Base` so just call:
```erb
<%= raw render_emoji('Text, containing emojis :mouse:') %>
```

###In Models, Controllers, etc
Include `Emoji4Rails::Helpers` to your class:
```ruby
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](https://github.com/petethepig/emoji4rails/issues)

###Thanks To
[These guys](https://github.com/arvida/emoji-cheat-sheet.com#contributors), I borrowed the images from this repo.
###LISENCE
MIT License. Copyright 2012 [Dmitry Filimonov](http://dfilimonov.com/).

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
emoji4rails-0.0.2 README.md
emoji4rails-0.0.1 README.md