Skip to content

Latest commit

 

History

History
67 lines (40 loc) · 1.89 KB

README.textile

File metadata and controls

67 lines (40 loc) · 1.89 KB

Signaturepad for ActiveScaffold

Currently, this plugin is compatible with ActiveScaffold >= 3.4 gem.

Overview

This plugin adds a signaturepad form_ui to display a signature area. It uses jquery.signaturepad

Installation

You’ll need at least ActiveScaffold 3.4 to use this

gem install active_scaffold_signaturepad

Usage

Step 1

Set column to use :signaturepad form_ui

Step 2

Setup signaturepad using options method on column

# app/controllers/visitors_controller.rb

class VisitorsController < ApplicationController
  active_scaffold :visitor do |config|
    config.columns[:signature].form_ui = :signaturepad
    config.columns[:signature].options = {
      :width => 150, # canvas width, default 250
      :height => 55, # canvas height, default 100
      :line_colour => 'transparent' # colour for signature line on canvas, transparent for none
    }
  end
end

Available options: line_colour, line_width, line_margin, line_top, bg_colour, pen_colour, pen_width, pen_cap, error_message_draw

See jquery.signaturepad doc for reference about options

If error_message_draw is a symbol it will be translated (using as_ method, so it must be on active_scaffold namespace)

Save image

Signaturepad sends a JSON representation to signature. It can be converted to image on server, adding some code to model:

https://gist.github.com/branch14/4258871

Support

If you have issues installing the plugin, search / post to the Active Scaffold forum or Create an issue

Contributing

Fork, hack, push, and request a pull:

http://github.com/activescaffold/active_scaffold_signaturepad/

License

Released under the MIT license (included).