Module: EasyPartials::ControllerAdditions::ClassMethods
- Defined in:
- lib/easy_partials/controller_additions.rb
Instance Method Summary collapse
-
#additional_partials(*locations) ⇒ Object
Add additional partial locations for the auto finding of partials (via the <% _partial_name %> mechanism).
Instance Method Details
#additional_partials(*locations) ⇒ Object
Add additional partial locations for the auto finding of partials (via the <% _partial_name %> mechanism). This can be a single partial directory, or a list of them. Each value should be a directory relative to the views directory, and should NOT contain a trailing “/”. The order the directories are added is the order they will be checked, however the local path will still be checked first (the global shared directory will be checked after all these additional directories).
For example:
additional_partials "shared/forms"
additional_partials "shared/accounting", "shared_accounting"
18 19 20 21 22 |
# File 'lib/easy_partials/controller_additions.rb', line 18 def additional_partials(*locations) before_filter do |controller| controller.instance_variable_set :@additional_partials, (locations + EasyPartials.shared_directories).flatten.uniq end end |