All Projects β†’ ID25 β†’ Rails_emoji_picker

ID25 / Rails_emoji_picker

Add emoji to your app 😺

Projects that are alternatives of or similar to Rails emoji picker

Torque Postgresql
Add support to complex resources of PostgreSQL, like data types, array associations, and auxiliary statements (CTE)
Stars: ✭ 130 (-7.8%)
Mutual labels:  rails
Kaiju
A drag and drop web editor for React components.
Stars: ✭ 135 (-4.26%)
Mutual labels:  rails
Relay Rails Blog
A graphql, relay and standard rails application powered demo weblog. We are using Graphql server and relay for our react component data needs.
Stars: ✭ 140 (-0.71%)
Mutual labels:  rails
Mumuki Laboratory
πŸ”¬ Where students practice and receive automated and human feedback
Stars: ✭ 131 (-7.09%)
Mutual labels:  rails
Pwa
Progressive Web Apps for Rails
Stars: ✭ 133 (-5.67%)
Mutual labels:  rails
Actioncable Vue
A Vue plugin that makes integrating Rails Action Cable dead-easy.
Stars: ✭ 138 (-2.13%)
Mutual labels:  rails
Rspec Openapi
Generate OpenAPI schema from RSpec request specs
Stars: ✭ 129 (-8.51%)
Mutual labels:  rails
Vueport
Single file components for Rails with Vue JS and Webpack
Stars: ✭ 141 (+0%)
Mutual labels:  rails
Super module
SuperModule allows defining class methods and method invocations the same way a super class does without using def included(base). This also succeeds ActiveSupport::Concern by offering lighter syntax
Stars: ✭ 133 (-5.67%)
Mutual labels:  rails
Redis web manager
Manage your Redis instance (see keys, memory used, connected client, etc...)
Stars: ✭ 139 (-1.42%)
Mutual labels:  rails
Spreewald
Our collection of useful cucumber steps.
Stars: ✭ 131 (-7.09%)
Mutual labels:  rails
Reactive record
Generate ActiveRecord models for a pre-existing Postgres db
Stars: ✭ 132 (-6.38%)
Mutual labels:  rails
Zen Rails Security Checklist
Checklist of security precautions for Ruby on Rails applications.
Stars: ✭ 1,765 (+1151.77%)
Mutual labels:  rails
Hyrax
Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
Stars: ✭ 131 (-7.09%)
Mutual labels:  rails
Credit card validations
πŸ’³ ruby gem for validating credit card numbers, generating valid numbers, luhn checks
Stars: ✭ 140 (-0.71%)
Mutual labels:  rails
Trace location
πŸ”Help you get reading the huge open souce libraries in Ruby and trace its source locations
Stars: ✭ 130 (-7.8%)
Mutual labels:  rails
Spotlight
Spotlight enables librarians, curators, and others who are responsible for digital collections to create attractive, feature-rich websites that highlight these collections.
Stars: ✭ 137 (-2.84%)
Mutual labels:  rails
Activeadmin Themes
Awesome themes for ActiveAdmin.
Stars: ✭ 141 (+0%)
Mutual labels:  rails
Redis dashboard
Sinatra app to monitor Redis servers.
Stars: ✭ 141 (+0%)
Mutual labels:  rails
Activejob Retry
Automatic retries for ActiveJob
Stars: ✭ 138 (-2.13%)
Mutual labels:  rails

Rails Emoji Picker

Simple integration of emoji picker with your rails application.

GitHub version Build Status

Preview

Rails Emoji Picker

Installation

Add this line to your application's Gemfile:

gem 'rails_emoji_picker'

Usage

Run command

rails g rails_emoji_picker:install

It copies emoji images to your /assets/images directory

Add emoji picker js file

application.js

//= require jquery
//= require rails_emoji_picker
//= require_tree .
And styles

application.css

/*
 *= require_tree .
 *= require rails_emoji_picker
 *= require bootstrap
 *= require_self
 */

application.scss or sass

@import 'rails_emoji_picker'

Next step, wrap your text input with css class emoji-picker-container

And add data-attribte data: { emojiable: true } to your input/text_area.

<p class="emoji-picker-container">
  <%= f.text_field :title, class: 'form-control', data: { emojiable: true } %>
</p>

To see emoji in views, wrap your text with helper content_with_emoji.

  <%= content_with_emoji(@post.title) %>

If you interpolate string, you need to call html_safe, because it's another string.

  <%= "Post body: #{content_with_emoji(@post.body)}".html_safe %>

Emoji Asset Host

By default when used with Rails, this gem will inherit Rails configured Rails.asset_host. Otherwise, you will need to manually configure the Emoji.asset_host as a string URL or a lambda/proc.

# String URL
Emoji.asset_host = 'http://mysite.com'

# Custom Host Proc, takes asset path as a param
Emoji.asset_host = lambda {|path| path.size % 2 == 0 ? 'http://even.com' : 'http://odd.com'}

Advices

Precompile emoji images in development for fast loading
Use github (or your hosting) as a CDN, to serve images.

Example:

# => /initializers/emoji_picker.rb

Emoji.asset_host = 'https://raw.githubusercontent.com'
Emoji.asset_path = '/ID25/rails_emoji_picker/master/lib/generators/rails_emoji_picker/emoji/'

That's all! 😺

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ID25/rails_emoji_picker.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].