Saving empty strings as nil for all forms in rails admin

565 views
Skip to first unread message

evan

unread,
Jun 10, 2012, 5:37:30 PM6/10/12
to rails_admin
Hello Everyone,

Is there an accepted way or hook of some kind that can be used to
force all empty strings for string field types to save as nil when
editing/creating with a rails admin form?

If not could someone point me in the direction where such a config/
hook might be added in the code and I'll give a patch a try. (Rather
new to the code, not sure where a good place to start might be for
hooking into the save process.)

Best,

Evan

evan

unread,
Jun 10, 2012, 6:14:40 PM6/10/12
to rails_admin
I ended up using nilify_blanks (https://github.com/rubiety/
nilify_blanks) and applying it to all models as appropriate.
Reply all
Reply to author
Forward
0 new messages