Giter Site home page Giter Site logo

wysia's Introduction

Wysia

A WYSIWYG for textarea to work with Rails 3 FormBuilders

This Gem uses

  • WYSIHTML5 <- this actually does all the hard work
  • Font Awesome <- used for scaling icons wich are AWESOME

Installation

In your Gemfile, add the following dependencies:

From rubygems

gem 'wysia'

Or use the last version

gem 'wysia', :git => 'https://github.com/jhny/wysia.git'

Run:

$ bundle install

Usage

Include the Javascript (wysihtm5) into your application.js:

//= require wysia.js

Include de css into your applications.css

@import "wysia.scss";

In your forms use the wysia_text_area helper

default usage

= form_for @user do |f|
  = f.wysia_text_area :about

Configuration

Available options:

  • All the usual options for a text_area can be used.
  • size: normal, small or mini. Affects the button size of the toolbar. normal is default.
  • js: inline or yield. Yields the javascript to a block called :javascript or its placed inline. inline is default.

using the options:

= f.wysia_text_area :about, {:class => "shaded comment grey remark", :rows => 3, :id => "about_#{@user.id}_remark", :size => "small"}
  1. If you use js: "yield" as option, the javascript is yielded to a block called :javascript. In your layout or view use:
yield :javascript
  1. If you have multiple wysia_text_area elements in a single page, you need to provide a ID to the options to make sure they are distinguisable for the javascript.

Contribute

Edit gem

Instead of pointing to the git repo, point to the local source #gem 'wysia', :path => "/home/user/src/wysia"

Submitting an Issue

We use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a [Gist][] that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, and operating system. Ideally, a bug report should include a pull request with failing specs.

Additional information

Authors

wysia's People

Contributors

hezus avatar jhny avatar

Watchers

Alastair Brunton avatar James Cloos avatar

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.