Skip to content

Commit

Permalink
Allow footnotes to be disabled with a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect authored and kbrock committed Jan 26, 2010
1 parent 6419641 commit 8715707
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/rails-footnotes/footnotes.rb
Expand Up @@ -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!
Expand Down Expand Up @@ -156,6 +158,10 @@ def xhr?
@controller.request.xhr?
end

def footnotes_disabled?
@controller.params[:footnotes] == "false"
end

#
# Insertion methods
#
Expand Down

0 comments on commit 8715707

Please sign in to comment.