inline_forms 6.2.4 → 6.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da0da56f70167a18cad534ee9ec06721c11a5402e51662b6d9ef474556ef0de9
4
- data.tar.gz: fe14b6e4912095742e3244e563756271a7a3bf8cd707d1669c70401b5c838f96
3
+ metadata.gz: b967f0544e2096871bd9f3f52b82128300b600223b361195aa7a74dd01d559e8
4
+ data.tar.gz: e95d72614cf11af7ea755b9b8397384dad15b53c8c5f3215e1173b623b398f56
5
5
  SHA512:
6
- metadata.gz: 9e6bc7963f7e64512bfedd1e5ad742b07f7063a1153e9cea5f158708e446f23b58517bf1bae41a6d2eaf8c818530f8ca39ebc2d182805507d7b87d230736e3cc
7
- data.tar.gz: c31de7d071bf503999f0b03b1b3bea0e46dbe376935478874682eee033ad13d2b1ebab09802972b9975e2ca8e6286b16c4cb93054d36816382319e6f32edb653
6
+ metadata.gz: b52626478e34025391d9bebe94ca04780d6c6bff0c32a5af74287626c2576a9419f762d812b5e5e41b99e0e5a9bbaf3d20195a139060e6726e0c3b4dfd037869
7
+ data.tar.gz: 5d1d295ddf3c1a473c1f845fba7f9587bf0385cd35372d3b843d784080a5e284866a197c40dfaa9e3c105fef038461f96611ee9747b9c008ff4daf62aad2b5d7
@@ -0,0 +1,28 @@
1
+ # -*- encoding : utf-8 -*-
2
+ InlineForms::SPECIAL_COLUMN_TYPES[:simple_file_field]=:string
3
+
4
+ def simple_file_field_show(object, attribute)
5
+ o = object.send(attribute)
6
+
7
+ if o.send(:present?)
8
+ filename = o.to_s
9
+ model = object.class.to_s.pluralize.underscore
10
+ link_to filename, "/#{model}/dl/#{object.id}" # route must exist!!
11
+ else
12
+ link_to_inline_edit object, attribute, msg
13
+ end
14
+ end
15
+
16
+ def simple_file_field_edit(object, attribute)
17
+ file_field_tag attribute, :class => 'input_text_field'
18
+ end
19
+
20
+ def simple_file_field_update(object, attribute)
21
+ object.send(attribute.to_s + '=', params[attribute.to_sym])
22
+ end
23
+
24
+ # You need to add a route to your routes.rb file:
25
+ # get '/:model/dl/:id' => 'your_controller#download', :as => 'download'
26
+ # and a method to your controller:
27
+ # def download
28
+ # FIXME
data/bin/inline_forms CHANGED
@@ -71,7 +71,7 @@ module InlineForms
71
71
  exit 1
72
72
  end
73
73
 
74
- if File.exists?(app_name)
74
+ if File.exist?(app_name)
75
75
  say "Error: APP exists", :red
76
76
  exit 1
77
77
  end
@@ -207,7 +207,7 @@ module InlineForms
207
207
  end
208
208
 
209
209
  def add_second_top_bar
210
- copy_file "_inline_forms_tabs.html.erb", "app/views/_inline_forms_tabs.html.erb" unless File.exists?('app/views/_inline_forms_tabs.html.erb')
210
+ copy_file "_inline_forms_tabs.html.erb", "app/views/_inline_forms_tabs.html.erb" unless File.exist?('app/views/_inline_forms_tabs.html.erb')
211
211
  end
212
212
 
213
213
  def add_tab
@@ -26,7 +26,7 @@ before_fork do |server, worker|
26
26
 
27
27
  old_pid = "#{app_path}/tmp/pids/unicorn.pid.oldbin"
28
28
 
29
- if File.exists?(old_pid) && server.pid != old_pid
29
+ if File.exist?(old_pid) && server.pid != old_pid
30
30
  begin
31
31
  Process.kill("QUIT", File.read(old_pid).to_i)
32
32
  rescue Errno::ENOENT, Errno::ESRCH
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "6.2.4"
3
+ VERSION = "6.2.6"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.4
4
+ version: 6.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-08-06 00:00:00.000000000 Z
13
+ date: 2024-02-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rvm
@@ -145,6 +145,7 @@ files:
145
145
  - app/helpers/form_elements/radio_button.rb
146
146
  - app/helpers/form_elements/scale_with_integers.rb
147
147
  - app/helpers/form_elements/scale_with_values.rb
148
+ - app/helpers/form_elements/simple_file_field.rb
148
149
  - app/helpers/form_elements/slider_with_values.rb
149
150
  - app/helpers/form_elements/text_area.rb
150
151
  - app/helpers/form_elements/text_area_without_ckeditor.rb
@@ -246,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
247
  - !ruby/object:Gem::Version
247
248
  version: '0'
248
249
  requirements: []
249
- rubygems_version: 3.1.4
250
+ rubygems_version: 3.4.6
250
251
  signing_key:
251
252
  specification_version: 4
252
253
  summary: Inline editing of forms.