inline_forms 1.0.1 → 1.0.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 CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -143,18 +143,19 @@ class InlineFormsController < ApplicationController
143
143
  #
144
144
  # PUT /examples/1
145
145
  #
146
- def update
147
- @object = @Klass.find(params[:id])
148
- @attribute = params[:attribute]
149
- @form_element = params[:form_element]
150
- @sub_id = params[:sub_id]
151
- @update_span = params[:update]
152
- send("#{@form_element.to_s}_update", @object, @attribute)
153
- @object.save
154
- respond_to do |format|
155
- format.js { }
146
+ def update
147
+ @object = @Klass.find(params[:id])
148
+ @attribute = params[:attribute]
149
+ @form_element = params[:form_element]
150
+ @sub_id = params[:sub_id]
151
+ @update_span = params[:update]
152
+ send("#{@form_element.to_s}_update", @object, @attribute)
153
+ @object.save
154
+ puts "Requested #{request.format}"
155
+ respond_to do |format|
156
+ format.js { }
157
+ end
156
158
  end
157
- end
158
159
 
159
160
  # :show shows one attribute (attribute) from a record (object). It inludes the link to 'edit'
160
161
  #
@@ -1,7 +1,8 @@
1
1
  InlineForms::SPECIAL_COLUMN_TYPES[:file_field]=:string
2
2
 
3
3
  def file_field_show(object, attribute)
4
- link_to_inline_edit object, attribute, object.send(attribute).url
4
+ puts "tets#{attribute}"
5
+ link_to_inline_edit object, attribute, 'xxx' #image_tag( object.send(attribute).send(:url) )
5
6
  end
6
7
 
7
8
  def file_field_edit(object, attribute)
@@ -9,6 +10,6 @@ def file_field_edit(object, attribute)
9
10
  end
10
11
 
11
12
  def file_field_update(object, attribute)
12
- object[attribute.to_sym] = params[attribute.to_sym]
13
+ object.send(attribute + '=', params[attribute.to_sym])
13
14
  end
14
15
 
@@ -0,0 +1,14 @@
1
+ InlineForms::SPECIAL_COLUMN_TYPES[:image_field]=:string
2
+
3
+ def image_field_show(object, attribute)
4
+ link_to_inline_edit object, attribute, image_tag( object.send(attribute).send(:url) )
5
+ end
6
+
7
+ def image_field_edit(object, attribute)
8
+ file_field_tag attribute, :class => 'input_text_field'
9
+ end
10
+
11
+ def image_field_update(object, attribute)
12
+ object.send(attribute + '=', params[attribute.to_sym])
13
+ end
14
+
@@ -9,6 +9,6 @@ def text_field_edit(object, attribute)
9
9
  end
10
10
 
11
11
  def text_field_update(object, attribute)
12
- object[attribute.to_sym] = params[attribute.to_sym]
12
+ object.send(attribute + '=', params[attribute.to_sym])
13
13
  end
14
14
 
data/inline_forms.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{inline_forms}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ace Suares"]
12
- s.date = %q{2011-10-06}
12
+ s.date = %q{2011-10-07}
13
13
  s.description = %q{Inline Forms aims to ease the setup of forms that provide inline editing. The field list can be specified in the model.}
14
14
  s.email = %q{ace@suares.an}
15
15
  s.extra_rdoc_files = [
@@ -65,6 +65,7 @@ Gem::Specification.new do |s|
65
65
  "app/helpers/form_elements/file_field.rb",
66
66
  "app/helpers/form_elements/geo_code_curacao.rb",
67
67
  "app/helpers/form_elements/image.rb",
68
+ "app/helpers/form_elements/image_field.rb",
68
69
  "app/helpers/form_elements/info.rb",
69
70
  "app/helpers/form_elements/infoadmin.rb",
70
71
  "app/helpers/form_elements/question_list.rb",
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: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ace Suares
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-06 00:00:00 -04:00
18
+ date: 2011-10-07 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -164,6 +164,7 @@ files:
164
164
  - app/helpers/form_elements/file_field.rb
165
165
  - app/helpers/form_elements/geo_code_curacao.rb
166
166
  - app/helpers/form_elements/image.rb
167
+ - app/helpers/form_elements/image_field.rb
167
168
  - app/helpers/form_elements/info.rb
168
169
  - app/helpers/form_elements/infoadmin.rb
169
170
  - app/helpers/form_elements/question_list.rb