inline_forms 1.6.5 → 1.6.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -113,7 +113,7 @@ class InlineFormsController < ApplicationController
|
|
113
113
|
@update_span = params[:update]
|
114
114
|
attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list
|
115
115
|
attributes.each do | attribute, name, form_element |
|
116
|
-
send("#{form_element.to_s}_update", @object, attribute) unless form_element == :associated
|
116
|
+
send("#{form_element.to_s}_update", @object, attribute) unless form_element == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute))
|
117
117
|
end
|
118
118
|
@parent_class = params[:parent_class]
|
119
119
|
@parent_id = params[:parent_id]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
InlineForms::SPECIAL_COLUMN_TYPES[:money_field]=:integer
|
3
3
|
|
4
4
|
def money_field_show(object, attribute)
|
5
|
-
link_to_inline_edit object, attribute
|
5
|
+
link_to_inline_edit object, attribute, humanized_money_with_symbol(object.send attribute)
|
6
6
|
end
|
7
7
|
|
8
8
|
def money_field_edit(object, attribute)
|
@@ -10,6 +10,6 @@ def money_field_edit(object, attribute)
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def money_field_update(object, attribute)
|
13
|
-
object.send(
|
13
|
+
object.send( "#{attribute}=", params[attribute])
|
14
14
|
end
|
15
15
|
|
@@ -26,7 +26,7 @@
|
|
26
26
|
</tr>
|
27
27
|
<% attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list -%>
|
28
28
|
<% attributes.each do | attribute, name, form_element | -%>
|
29
|
-
<% unless form_element.to_sym == :associated -%>
|
29
|
+
<% unless form_element.to_sym == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute)) -%>
|
30
30
|
<% css_class_id = "attribute_#{attribute}_#{@object.id}" -%>
|
31
31
|
<tr>
|
32
32
|
<td valign="top" class="<%= 'has_validations ' if @object.has_validations_for?(attribute) -%>" validation-hint="<%= validation_hints_as_list_for(@object, attribute) -%>">
|
data/lib/inline_forms/version.rb
CHANGED