Permalink
Browse files

Allow footnotes to be disabled with a parameter

  • Loading branch information...
1 parent 6419641 commit 8715707480ab71ba667c78a74bf89f314c4ddf59 @indirect indirect committed with kbrock Jan 24, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/rails-footnotes/footnotes.rb
View
8 lib/rails-footnotes/footnotes.rb
@@ -119,7 +119,9 @@ def close!(controller)
protected
def valid?
- performed_render? && valid_format? && valid_content_type? && @body.is_a?(String) && !component_request? && !xhr?
+ performed_render? && valid_format? && valid_content_type? &&
+ @body.is_a?(String) && !component_request? && !xhr? &&
+ !footnotes_disabled?
end
def add_footnotes_without_validation!
@@ -156,6 +158,10 @@ def xhr?
@controller.request.xhr?
end
+ def footnotes_disabled?
+ @controller.params[:footnotes] == "false"
+ end
+
#
# Insertion methods
#

0 comments on commit 8715707

Please sign in to comment.