ActiveAdmin Form Field For Strongbox Encrypted Attribute
If you are using ActiveAdmin or formtastic (which ActiveAdmin uses under the hood) and are having trouble rendering a form with an encrypted attribute like with Strongbox the solution is very, very simple. Perhaps though it is not so obvious.
What you might be seeing is something like this…
Unable to find input class for binary
With the source of the error being
Lets look at this contrived example and assume that the ssn attribute is encrypted by Strongbox on our User model. The ssn column in my experience then should be a binary type in your db/schema.rb. That translates to bytea in Postgresql, and blob in MySQL and Sqlite3.
form do |f| f.inputs "User" do f.input :email f.input :password f.input :ssn end f.actions end
All we have to do in order to get out of this hole is to tell formtastic we want to
Continue reading →