inline_forms 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/app/helpers/form_elements/associated.rb +2 -5
- data/app/views/inline_forms/_subform.html.erb +2 -2
- data/inline_forms.gemspec +1 -1
- data/lib/inline_forms.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.2
|
@@ -1,9 +1,9 @@
|
|
1
|
-
InlineForms::SPECIAL_COLUMN_TYPES[:associated]=:
|
1
|
+
InlineForms::SPECIAL_COLUMN_TYPES[:associated]=:no_migration
|
2
2
|
|
3
3
|
# associated
|
4
4
|
def associated_show(object, attribute)
|
5
5
|
#show a list of records
|
6
|
-
out =
|
6
|
+
out = String.new
|
7
7
|
if @sub_id && @sub_id.to_i > 0
|
8
8
|
# if it's not a new record (sub_id > 0) then just update the list-element
|
9
9
|
out << '<li>'
|
@@ -12,7 +12,6 @@ def associated_show(object, attribute)
|
|
12
12
|
:attribute => attribute,
|
13
13
|
:sub_id => @sub_id,
|
14
14
|
:form_element => this_method.reverse.sub(/.*_/,'').reverse,
|
15
|
-
:values => values,
|
16
15
|
:update => "attribute_#{attribute.to_s.singularize}_#{@sub_id.to_s}" ),
|
17
16
|
:method => :get,
|
18
17
|
:remote => true )
|
@@ -26,7 +25,6 @@ def associated_show(object, attribute)
|
|
26
25
|
:attribute => attribute,
|
27
26
|
:sub_id => 0,
|
28
27
|
:form_element => this_method.sub(/_[a-z]+$/,''),
|
29
|
-
:values => values,
|
30
28
|
:update => "list_#{attribute}_#{object.id.to_s}" ),
|
31
29
|
:method => :get,
|
32
30
|
:remote => true )
|
@@ -41,7 +39,6 @@ def associated_show(object, attribute)
|
|
41
39
|
:attribute => attribute,
|
42
40
|
:sub_id => m.id,
|
43
41
|
:form_element => this_method.sub(/_[a-z]+$/,''),
|
44
|
-
:values => values,
|
45
42
|
:update => "attribute_#{attribute.to_s.singularize}_#{m.id.to_s}" ),
|
46
43
|
:method => :get,
|
47
44
|
:remote => true )
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<table cellpadding="0" cellspacing="0" class="subform">
|
2
|
-
<% @associated_record.
|
2
|
+
<% @associated_record.inline_forms_attribute_list.each do | @subform_field, @subform_description, @subform_element | %>
|
3
3
|
<tr>
|
4
4
|
<td valign="top">
|
5
5
|
<div class="subform_field-name">
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</td>
|
9
9
|
<td valign="top">
|
10
10
|
<div class="subform_field-value">
|
11
|
-
<%= send("#{@subform_element}_edit", @associated_record, @subform_field.to_s
|
11
|
+
<%= send("#{@subform_element}_edit", @associated_record, @subform_field.to_s) %>
|
12
12
|
</div>
|
13
13
|
</td>
|
14
14
|
</tr>
|
data/inline_forms.gemspec
CHANGED
data/lib/inline_forms.rb
CHANGED
@@ -117,10 +117,10 @@ module InlineForms
|
|
117
117
|
# The stuff in this hash will add a line to the model, but little else.
|
118
118
|
SPECIAL_RELATIONS = {
|
119
119
|
:has_many => :no_migration,
|
120
|
+
:has_many_destroy => :no_migration,
|
120
121
|
:has_one => :no_migration,
|
121
122
|
:has_and_belongs_to_many => :no_migration,
|
122
123
|
:habtm => :no_migration,
|
123
|
-
:habtm_destroy => :no_migration,
|
124
124
|
}
|
125
125
|
|
126
126
|
# Declare as a Rails::Engine, see http://www.ruby-forum.com/topic/211017#927932
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 2
|
10
|
+
version: 0.8.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ace Suares
|