-
-
Save branch14/4258871 to your computer and use it in GitHub Desktop.
# see https://github.com/thomasjbradley/signature-pad for more details | |
instructions = JSON.load(data).map { |h| "line #{h['mx']},#{h['my']} #{h['lx']},#{h['ly']}" } * ' ' | |
system "convert -size 198x55 xc:transparent -stroke blue -draw '#{instructions}' signature.png" |
Can you create a demo app for us noobs on RoR
im getting this error with paperclip Paperclip::AdapterRegistry::NoHandlerError
the before_save its not running
some body got sample with paperclip.
@soffes thanks but cant get it to work with paperclip with that one
cant get to convert the data
I'm having issues with this as well. I get the error Paperclip::AdapterRegistry::NoHandlerError and No handler found for "[{.
Any suggestions??
Thanks!
Does anyone have any examples on how to actually, save signature to database using rails?
Deployed this successfully - unfortunately the signature doesn't fit in the form well. It cuts off portions of the signature - any ideas on how to resize not just the pad as shown in the documentation, but the signature itself?
Has anyone done this with CarrierWave? I'm new to rails, and don't have a clue how to even get started with this.
@kzink
paperclip attachment gives error " content type discovered from file command: inode/x-empty " and signature image is not attached to model
-draw @- seems to return without asking for STDIN input on OS X now.
is there any way to adjust the stroke font size ?
@lrbz - checkout signature-pad's options'. By default stroke is 2px wide, but you can adjust it :)
create file field hidden id profile_signature for attachment
var canvas = document.querySelector("canvas");
var imfile;
canvas.toBlob((blob) => {
imfile = new File([blob], "signature.jpg", { type: "image/jpeg" })
let dt = new DataTransfer();
dt.items.add(imfile);
document.getElementById("profile_signature").files = dt.files;
});
first it will convert base64 into image and then attach it to your hidden field
create file field hidden id profile_signature for attachment
var canvas = document.querySelector("canvas"); var imfile; canvas.toBlob((blob) => { imfile = new File([blob], "signature.jpg", { type: "image/jpeg" }) let dt = new DataTransfer(); dt.items.add(imfile); document.getElementById("profile_signature").files = dt.files; });
first it will convert base64 into image and then attach it to your hidden field
Here, the field "profile_signature" will look like what in HTML?
@harshitDispatch Looks like it should be a <input type="file">
@harshitDispatch Looks like it should be a
<input type="file">
@branch14 Yeah that worked. Thanks for the help.
In case you're using Mongoid and would like to store the signature directly in mongodb...
...
to display ...