blocks 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/blocks/builder.rb +7 -2
  2. metadata +4 -4
@@ -58,7 +58,7 @@ module Blocks
58
58
  self.start_rendering_blocks = false
59
59
 
60
60
  if shared_options[:block]
61
- view.capture(self, &shared_options[:block])
61
+ shared_options[:captured_block] = view.capture(self, &shared_options[:block])
62
62
  end
63
63
 
64
64
  self.start_rendering_blocks = true
@@ -163,7 +163,12 @@ module Blocks
163
163
  view.concat(view.capture shared_options.merge(block_container.options).merge(render_options), &block_container.block)
164
164
  else
165
165
  begin
166
- view.concat(view.render "#{shared_options[:templates_folder]}/#{name.to_s}", shared_options.merge(render_options))
166
+ begin
167
+ view.concat(view.render "#{name.to_s}", shared_options.merge(render_options))
168
+ rescue ActionView::MissingTemplate
169
+ # This partial did not exist in the current controller's view directory; now checking in the default templates folder
170
+ view.concat(view.render "#{shared_options[:templates_folder]}/#{name.to_s}", shared_options.merge(render_options))
171
+ end
167
172
  rescue ActionView::MissingTemplate
168
173
  # This block does not exist and no partial can be found to satify it
169
174
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blocks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Hunter
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-07 00:00:00 -05:00
19
+ date: 2011-01-09 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies: []
22
22