recordselect 3.3.8 → 3.3.9

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.
@@ -186,10 +186,13 @@ RecordSelect.Abstract = Class.extend({
186
186
  jQuery.rails.fire(_this.obj, 'rs:before');
187
187
  _this.container.html('');
188
188
  _this.container.show();
189
+ var params = _this.obj.data('params');
190
+ var search_params = jQuery.param({search: _this.obj.val()});
191
+ params = params ? [params, search_params].join("&") : search_params;
189
192
  jQuery.ajax({
190
193
  url: this.url,
191
194
  //type: "POST",
192
- data: _this.obj.data('params'),
195
+ data: params,
193
196
  //dataType: options.ajax_data_type,
194
197
  success: function(data){
195
198
  _this.container.html(data);
@@ -92,6 +92,7 @@ Object.extend(RecordSelect.Abstract.prototype, {
92
92
  this.container.show();
93
93
  new Ajax.Updater(this.container, this.url, {
94
94
  method: 'get',
95
+ parameters: {search: $F(this.obj)},
95
96
  evalScripts: true,
96
97
  asynchronous: true,
97
98
  onComplete: function() {
@@ -160,16 +160,16 @@ module RecordSelectHelper
160
160
  # if given a controller, searches for a partial in its views path
161
161
  def label_for_field(record, controller = self.controller)
162
162
  renderer = controller.record_select_config.label
163
- case renderer
163
+ description = case renderer
164
164
  when Symbol, String
165
165
  # find the <label> element and grab its innerHTML
166
- description = render_record_from_config(record, File.join(controller.controller_path, renderer.to_s))
167
- description.match(/<label[^>]*>(.*)<\/label>/)[1]
166
+ render_record_from_config(record, File.join(controller.controller_path, renderer.to_s))
168
167
 
169
168
  when Proc
170
169
  # just return the string
171
170
  render_record_from_config(record, renderer)
172
171
  end
172
+ description.match(/<label[^>]*>(.*)<\/label>/)[1]
173
173
  end
174
174
 
175
175
  def assert_controller_responds(controller_name)
@@ -2,7 +2,7 @@ module RecordSelect
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 8
5
+ PATCH = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recordselect
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
- - 8
10
- version: 3.3.8
9
+ - 9
10
+ version: 3.3.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Cambra
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2014-09-30 00:00:00 Z
20
+ date: 2014-10-31 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  type: :development