easy_partials 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{easy_partials}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Samer Abukhait"]
12
- s.date = %q{2010-07-16}
12
+ s.date = %q{2010-08-23}
13
13
  s.description = %q{An easier way to call partials}
14
14
  s.email = %q{abukhait@gmail.com}
15
15
  s.extra_rdoc_files = [
data/lib/easy_partials.rb CHANGED
@@ -161,3 +161,29 @@ module ApplicationHelper
161
161
  end
162
162
 
163
163
  end
164
+
165
+ class ApplicationController
166
+
167
+ # Add additional partial locations for the auto finding of partials
168
+ # (via the <% _partial_name %> mechanism). This can be a single
169
+ # partial directory, or a list of them. Each value should be a
170
+ # directory relative to the views directory, and should NOT contain
171
+ # a trailing "/". The order the directories are added is the order
172
+ # they will be checked, however the local path will still be checked
173
+ # first (the global shared directory will be checked after all these
174
+ # additional directories).
175
+ #
176
+ # For example:
177
+ #
178
+ # additional_partials "shared/forms"
179
+ # additional_partials "shared/accounting", "shared_accounting"
180
+ def self.additional_partials(*partials)
181
+ before_filter { |controller|
182
+ values = controller.instance_variable_get :@additional_partials
183
+ values = values || []
184
+ values.push *partials
185
+ controller.instance_variable_set :@additional_partials, values
186
+ }
187
+ end
188
+
189
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_partials
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Samer Abukhait
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-16 00:00:00 -07:00
18
+ date: 2010-08-23 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency