I have a column that stores JSON data. I do not know how to show this when it is in an editing state.
serialize :value, JSON = f.fields_for :value do |ff| .form-group = ff.label :short = ff.text_field :short, class: 'form-control' .form-group = ff.label :long = ff.text_field :long, class: 'form-control'
Instead
= f.fields_for :value do |ff|
use the following code:
= f.fields_for :value, OpenStruct.new(@object.value) do |ff|
You will need to replace @object with a model object.
@object
Source: https://habr.com/ru/post/1203690/More articles:Laravel 5: send, fix and delete requests without using Form builder - putHow to convert a dataframe list to a dataframe that has a new column, displays the list name in R - listError declaring a class with std :: vector structures containing std :: unique_ptr - c ++How to create a new column with the names in the list - rPink / reddish tint when resizing jpeg images using java sketch or imgscalr - javaCreating a data frame from list values - listSubclassing MKCircle in Swift - inheritanceIs it possible to automatically log in to Google Drive or Dropbox with static credentials without logging in? - iosMongodb summary query with - mongodbBest practices for implementing Factory pattern using Symfony2 - symfonyAll Articles