GithubHelp home page GithubHelp logo

emn178 / kolor-picker-rails Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 22 KB

Integrate with kolor-picker to provide color picker and form helper.

License: MIT License

Ruby 26.82% JavaScript 65.04% CSS 8.15%

kolor-picker-rails's Introduction

kolor-picker-rails

Build Status Coverage Status

Integrate with kolor-picker to provide color picker and form helper.

Installation

Add this line to your application's Gemfile:

gem 'kolor-picker'

And then execute:

bundle

Or install it yourself as:

gem install kolor-picker

Usage

Require Javascript

Make sure you required jQuery and add the following to /app/assets/javascripts/application.js:

//= require kolor-picker

Require CSS

Add the following to /app/assets/stylesheets/application.css:

/*
 *= require kolor-picker
 */

Helpers

You can use colorpicker_tag and colorpicker.

<%= colorpicker_tag(name, default_color, kolor_picker_options, html_options) %>
<%= colorpicker_tag(:color, 'red', {:doRender => false}, {:class => 'color'}) %>
<%= colorpicker_tag(:color) %>

or form builder

<% form_for @item do |f| %>
<%= f.colorpicker(method, kolor_picker_options, html_options) %>
<%= f.colorpicker(:color, {:doRender => false}, {:class => 'color'}) %>
<%= f.colorpicker(:color) %>
<% end %>

License

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

Contact

The project's website is located at https://github.com/emn178/kolor-picker-rails
Author: Chen, Yi-Cyuan ([email protected])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.