ajax 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ./
3
3
  specs:
4
- ajax (1.1.1)
4
+ ajax (1.1.2)
5
5
  json
6
6
  rack
7
7
 
@@ -10,6 +10,7 @@ As of May 2010 Ajax is being used live in production on kazaa.com[http://www.kaz
10
10
 
11
11
  == Changelog
12
12
 
13
+ * v1.1.2: Fix Rails 3 render hook so it doesn't break rendering with no layout e.g. <tt>render :json => ...</tt>
13
14
  * v1.1.1: Backwards compatibility fix for Rails < 3
14
15
  * v1.1.0: Rails 3 supported!
15
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -125,22 +125,19 @@ module Ajax
125
125
  end
126
126
  end
127
127
 
128
- #
129
- # Intercept rendering to customize the headers and layout handling
130
- #
131
- def render_to_body(options = {})
132
- return super if !request.xhr? || !Ajax.is_enabled?
133
- _process_options(options)
134
-
135
- if ajax_layout = _layout_for_ajax(options[:layout])
136
- options[:layout] = ajax_layout.virtual_path
128
+ # Specialize the default layout finder. Try to use a layout in layouts/ajax
129
+ # as the default layout, if one exists.
130
+ def _default_layout(require_layout = false)
131
+ if require_layout || !request.xhr? || !Ajax.is_enabled?
132
+ super
133
+ else
134
+ layout_name = super
135
+ if ajax_layout = _layout_for_ajax(layout_name)
136
+ ajax_layout.virtual_path
137
+ else
138
+ layout_name
139
+ end
137
140
  end
138
-
139
- # Send the current layout and controller in a custom response header
140
- Ajax.set_header(response, :layout, options[:layout])
141
- Ajax.set_header(response, :controller, self.class.controller_name)
142
-
143
- _render_template(options)
144
141
  end
145
142
  end
146
143
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ajax
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Karl Varga
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-27 00:00:00 -07:00
18
+ date: 2011-05-03 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency