bhf 0.4.33 → 0.4.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,15 +27,17 @@ class Bhf::EntriesController < Bhf::ApplicationController
27
27
  manage_many_to_many
28
28
  after_save
29
29
 
30
- redirect_back_or_default(bhf_page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('create.success', @model))
31
- else
32
- @form_url = bhf_entries_path(@platform.name)
33
-
34
30
  if @quick_edit
35
31
  render json: object_to_bhf_display_hash, status: :ok
36
32
  else
37
- render :new
33
+ redirect_back_or_default(bhf_page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('create.success', @model))
38
34
  end
35
+ else
36
+ @form_url = bhf_entries_path(@platform.name)
37
+
38
+ r_settings = {status: :unprocessable_entity}
39
+ r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
40
+ render :new, r_settings
39
41
  end
40
42
  end
41
43
 
@@ -98,7 +100,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
98
100
  private
99
101
 
100
102
  def object_to_bhf_display_hash
101
- @platform.columns.each_with_object({to_bhf_s: @object.to_bhf_s, new_record: @object.new_record?}) do |column, hash|
103
+ @platform.columns.each_with_object({to_bhf_s: @object.to_bhf_s, edit_path: edit_bhf_entry_path(@platform.name, @object)}) do |column, hash|
102
104
  unless column.field.macro == :column && @object.send(column.name).blank?
103
105
  p = "bhf/pages/macro/#{column.field.macro}/#{column.field.display_type}.html"
104
106
  hash[column.name] = render_to_string partial: p, locals: {column: column, object: @object}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.33
4
+ version: 0.4.34
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-15 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails