Brantron / john_hancock

A Rails gem for custom signature form fields
MIT License
114 stars 27 forks source link

Datatype of signature ? #11

Closed julesmaregiano closed 6 years ago

julesmaregiano commented 6 years ago

Hello sir, This is a newbie question : In order to save the signature, do I need to make a migration and add a :signature to my Report model for instance ? And if yes, what is the datatype of that new column ? Thanks in advance for your help, I am a newbie and despite looking around I couldn't find detailed infos about how to install your awesome gem.

bjmllr commented 6 years ago

The image data is Base64 encoded, so in the first app we made that accepted signatures, we saved them to a database using a text field. In the context of a rails create_table, it looks something like:

create_table :shift_events do |t|
  t.references :user
  t.text :signature # <= this one
  t.timestamps null: false
end