Skip to content

IGPython/jSignature

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jSignature for Rails

Add to your gemfile

gem "jSignature", "~> 0.0.6"

and run

bundle install

or install manually

gem install jSignature

You can use helper method to add sign field to form:

<%= sign_form_field_tag(:name) %>

which sends field 'name': data:image/png;base64,i1234lkj123;k4;l1j34l1kj3j... 

or

<%= form_for :model do |f| %>
  <%= f.sign_field(:name) %>
  <%= f.submit("Send") %>
<% end %>

which sends field 'model[name]': data:image/png;base64,i1234lkj123;k4;l1j34l1kj3j... 

You can Specify the capture format as detailed in the jSignature as follows

<%= form_for :model do |f| %>
  <%= f.sign_field(:name, :svg) %>
  <%= f.submit("Send") %>
<% end %>

or 
<%= sign_form_field_tag(:name, :svg) %>


which sends field 'model[name]': image/svg+xml,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="367" height="103"><path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M 86 102 c -0.38 0 -... 

License:

MIT

All files from app/assets/javascripts (except jsignature.js) directory are Copyright 2012 Willow Systems Corp

Feedback

If you are using this gem, give me a feedback. Nice to hear your suggestion for future developement

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 95.4%
  • JavaScript 4.6%