active_scaffold_vho 3.0.22 → 3.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{active_scaffold_vho}
8
- s.version = "3.0.22"
8
+ s.version = "3.0.23"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Many, see README"]
12
- s.date = %q{2011-10-22}
12
+ s.date = %q{2011-11-05}
13
13
  s.description = %q{Save time and headaches, and create a more easily maintainable set of pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read, update, delete) user interface needs, leaving you more time to focus on more challenging (and interesting!) problems.}
14
14
  s.email = %q{activescaffold@googlegroups.com}
15
15
  s.extra_rdoc_files = [
@@ -457,12 +457,9 @@ var ActiveScaffold = {
457
457
  if (typeof(element) == 'string') element = '#' + element;
458
458
  element = $(element);
459
459
  ActiveScaffold.trigger_unload_events(element.find('[data-as_load]').andSelf());
460
- element.replaceWith(html);
461
- if (element.attr('id')) {
462
- element = $('#' + element.attr('id'));
463
- }
464
- ActiveScaffold.trigger_load_events(element.find('[data-as_load]').andSelf());
465
- return element;
460
+ var new_element = $(html).replaceAll(element);
461
+ ActiveScaffold.trigger_load_events(new_element.find('[data-as_load]').andSelf());
462
+ return new_element;
466
463
  },
467
464
 
468
465
  replace_html: function(element, html) {
@@ -411,12 +411,13 @@ var ActiveScaffold = {
411
411
  var elements = element.select('[data-as_load]');
412
412
  elements.unshift(element);
413
413
  ActiveScaffold.trigger_unload_events(elements);
414
- Element.replace(element, html);
415
- element = $(element.readAttribute('id'));
416
- elements = element.select('[data-as_load]');
417
- elements.unshift(element);
414
+ var new_element = new Element('div').update(html);
415
+ new_element = new_element.firstDescendant();
416
+ Element.replace(element, new_element);
417
+ elements = new_element.select('[data-as_load]');
418
+ elements.unshift(new_element);
418
419
  ActiveScaffold.trigger_load_events(elements);
419
- return element;
420
+ return new_element;
420
421
  },
421
422
 
422
423
  replace_html: function(element, html) {
@@ -605,7 +606,7 @@ var ActiveScaffold = {
605
606
  if (element) {
606
607
  if (options.is_subform == false) {
607
608
  ActiveScaffold.trigger_unload_events(new Array(element.up('li.form-element')));
608
- this.replace(element.up('dl'), content);
609
+ element = this.replace(element.up('dl'), content);
609
610
  ActiveScaffold.trigger_load_events(new Array(element.up('li.form-element')));
610
611
  } else {
611
612
  this.replace_html(element, content);
@@ -150,7 +150,7 @@ module ActiveScaffold::Actions
150
150
  params = params[:record] || {} unless params[model.inheritance_column] # in create action must be inside record key
151
151
  model = params.delete(model.inheritance_column).camelize.constantize if params[model.inheritance_column]
152
152
  end
153
- model.new(build_options || {})
153
+ model.respond_to?(:build) ? model.build(build_options || {}) : model.new
154
154
  end
155
155
 
156
156
  private
@@ -18,6 +18,7 @@ module ActionView::Rendering #:nodoc:
18
18
  # Adds two rendering options.
19
19
  #
20
20
  # ==render :super
21
+ # ==render :super, :locals =>{:headline => 'formheadline'}
21
22
  #
22
23
  # This syntax skips all template overrides and goes directly to the provided ActiveScaffold templates.
23
24
  # Useful if you want to wrap an existing template. Just call super!
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- PATCH = 22
5
+ PATCH = 23
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: active_scaffold_vho
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
4
+ hash: 41
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 22
10
- version: 3.0.22
9
+ - 23
10
+ version: 3.0.23
11
11
  platform: ruby
12
12
  authors:
13
13
  - Many, see README
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-22 00:00:00 +02:00
18
+ date: 2011-11-05 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency