Commit e17edc53 by liyijie

feat: 更改single 额外属性的位置

parent f568bf42
<%- if active_record? -%> <%- if active_record? -%>
json.extract!( json.extract!(
<%= resource_singular %>, <%= resource_singular %>,
*<%= resource_singular %>.class.try(:extra_permitted_attributes),
:id, :id,
:created_at, :created_at,
:updated_at, :updated_at,
<%- attributes_names.each do |attribute_name| -%> <%- attributes_names.each do |attribute_name| -%>
:<%= attribute_name %>, :<%= attribute_name %>,
<%- end -%> <%- end -%>
*<%= resource_singular %>.class.try(:extra_permitted_attributes),
) )
<%- else -%> <%- else -%>
json.merge! <%= resource_singular %>.as_json json.merge! <%= resource_singular %>.as_json
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment