Showing posts with label Gem. Show all posts
Showing posts with label Gem. Show all posts

Wednesday, January 11, 2017

Spawnling Gem in rails

Spawnling gem:

This gem provides a 'Spawnling' class to easily fork OR thread long-running sections of code so that your application can return results to your users more quickly. It works by creating new database connections in ActiveRecord::Base for the spawned block so that you don't have to worry about database connections working, they just do.

Step 1: Gem add in Gemfile:

            gem 'spawnling'

Step 2: Add in database.yml file

            production/development:
       ..............
       ..............
       reconnect: true

Step 3: Usages:

      Spawnling.new do

       @calendar.send_notification_to_team # method name

      end

Saturday, August 27, 2016

Ckeditor Gem

CKEditor:
CKEditor is a WYSIWYG text editor designed to simplify web content creation. It brings common word processing features directly to your web pages. Enhance your website experience with our community maintained editor.

Step 1:

add gem to gemfile 

gemfile

gem 'ckeditor_rails'

Step 2:

In Terminal

$ bundle install

Step 3:

 Include CKEditor javascript assets

app/assets/javascripts/user.js

//= require ckeditor-jquery

Step 4:
 Configure plugins, languages, and skins of CKEditor assets

config/initializers/assets.rb

Ckeditor::Rails.configure do |config|
  # default is nil for all languages, or set as %w[en zh]
  config.assets_languages = nil
  # default is nil for all plugins,
  # or set as white list: %w[image link liststyle table tabletools]
  # or set as black list: config.default_plugins - %w[about a11yhelp]
  config.assets_plugins = nil
  # default is nil for all skins, or set as %w[moono]
  config.assets_skins = nil
end