This repository has been archived by the owner on Dec 21, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ben VandenBos
committed
Sep 23, 2008
1 parent
f32b024
commit e7bed84
Showing
2 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
# these should all be defined... | ||
ActionView::Base | ||
|
||
module ActionView::Base | ||
class ActionView::Base | ||
|
||
private | ||
|
||
def self.perform_partial_comments? | ||
# TODO: make this some kind of configuration in environments | ||
RAILS_ENV == 'development' | ||
end | ||
|
||
# don't even define this method if we don't want to | ||
if preform_partial_comments? | ||
# don't even define this method if we don't want it enabled | ||
if perform_partial_comments? | ||
|
||
# render_partial(partial_path, object_assigns = nil, local_assigns = {}) | ||
def render_partial_with_comments(partial_path, object_assigns = nil, local_assigns = {}) | ||
r = '' | ||
r << %{<!-- render_start '#{template_path}' -->} if self.class.perform_partial_comments? | ||
r << render_for_file_without_comments(template_path, state, layout, locals) | ||
r << %{<!-- render_end '#{template_path}' -->} if self.class.perform_partial_comments? | ||
r = %{<!-- render_begin '#{partial_path}' -->} | ||
r << render_partial_without_comments(partial_path, object_assigns, local_assigns) | ||
r << %{<!-- render_end '#{partial_path}' -->} | ||
r | ||
end | ||
|
||
alias_method_chain :render_partial, :comments | ||
|
||
end | ||
end |