bhf 0.4.32 → 0.4.33
Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,12 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
30
30
|
redirect_back_or_default(bhf_page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('create.success', @model))
|
31
31
|
else
|
32
32
|
@form_url = bhf_entries_path(@platform.name)
|
33
|
-
|
33
|
+
|
34
|
+
if @quick_edit
|
35
|
+
render json: object_to_bhf_display_hash, status: :ok
|
36
|
+
else
|
37
|
+
render :new
|
38
|
+
end
|
34
39
|
end
|
35
40
|
end
|
36
41
|
|
@@ -93,7 +98,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
93
98
|
private
|
94
99
|
|
95
100
|
def object_to_bhf_display_hash
|
96
|
-
@platform.columns.each_with_object({to_bhf_s: @object.to_bhf_s}) do |column, hash|
|
101
|
+
@platform.columns.each_with_object({to_bhf_s: @object.to_bhf_s, new_record: @object.new_record?}) do |column, hash|
|
97
102
|
unless column.field.macro == :column && @object.send(column.name).blank?
|
98
103
|
p = "bhf/pages/macro/#{column.field.macro}/#{column.field.display_type}.html"
|
99
104
|
hash[column.name] = render_to_string partial: p, locals: {column: column, object: @object}
|