json_record
json_record copied to clipboard
Attributes not recalled in Rails FormHelpers
For all serialized keys I have to manually specify the values in all inputs. Somehow Rails form helpers just don't see them unless I put them in there explicitly. Could it be something about json_records' setter methods? Poking at it now but from what I can see it should just work. Let me know if you can replicate, will keep digging here.
# Model
class Template < ActiveRecord::Base
serialize_to_json(:data) do |schema|
schema.key :name
end
end
# View
= f.text_field :name
# Does not show data even if it has been saved. only solution for now is:
= f.text_field :name, :value => @site.smtp_email