Module: Fortitude

Defined in:
lib/fortitude/tags/tag.rb,
lib/fortitude/errors.rb,
lib/fortitude/widget.rb,
lib/fortitude/erector.rb,
lib/fortitude/version.rb,
lib/fortitude/widgets.rb,
lib/fortitude/doctypes.rb,
lib/fortitude/widget/tags.rb,
lib/fortitude/widget/files.rb,
lib/fortitude/widget/needs.rb,
lib/fortitude/doctypes/base.rb,
lib/fortitude/rails/helpers.rb,
lib/fortitude/rails/railtie.rb,
lib/fortitude/rails/railtie.rb,
lib/fortitude/widgets/html5.rb,
lib/fortitude/doctypes/html4.rb,
lib/fortitude/doctypes/html5.rb,
lib/fortitude/rails/renderer.rb,
lib/fortitude/tags/tag_store.rb,
lib/fortitude/widget/content.rb,
lib/fortitude/widget/helpers.rb,
lib/fortitude/widget/doctypes.rb,
lib/fortitude/widgets/xhtml11.rb,
lib/fortitude/doctypes/xhtml10.rb,
lib/fortitude/doctypes/xhtml11.rb,
lib/fortitude/tags/tag_support.rb,
lib/fortitude/tags/tags_module.rb,
lib/fortitude/widget/capturing.rb,
lib/fortitude/widget/rendering.rb,
lib/fortitude/rendering_context.rb,
lib/fortitude/widget/convenience.rb,
lib/fortitude/widget/integration.rb,
lib/fortitude/widget/localization.rb,
lib/fortitude/rails/widget_methods.rb,
lib/fortitude/widget/staticization.rb,
lib/fortitude/widgets/html4_strict.rb,
lib/fortitude/doctypes/html4_strict.rb,
lib/fortitude/support/assigns_proxy.rb,
lib/fortitude/tags/tag_return_value.rb,
lib/fortitude/widget/around_content.rb,
lib/fortitude/rails/template_handler.rb,
lib/fortitude/widgets/html4_frameset.rb,
lib/fortitude/widgets/xhtml10_strict.rb,
lib/fortitude/doctypes/html4_frameset.rb,
lib/fortitude/doctypes/xhtml10_strict.rb,
lib/fortitude/rails/rendering_methods.rb,
lib/fortitude/tilt/fortitude_template.rb,
lib/fortitude/widget/tag_like_methods.rb,
lib/fortitude/doctypes/unknown_doctype.rb,
lib/fortitude/widgets/xhtml10_frameset.rb,
lib/fortitude/doctypes/xhtml10_frameset.rb,
lib/fortitude/support/method_overriding.rb,
lib/fortitude/support/staticized_method.rb,
lib/fortitude/doctypes/html4_tags_strict.rb,
lib/fortitude/widget/temporary_overrides.rb,
lib/fortitude/widgets/html4_transitional.rb,
lib/fortitude/doctypes/html4_transitional.rb,
lib/fortitude/doctypes/html4_tags_frameset.rb,
lib/fortitude/tags/partial_tag_placeholder.rb,
lib/fortitude/widgets/xhtml10_transitional.rb,
lib/fortitude/doctypes/xhtml10_transitional.rb,
lib/fortitude/rails/fortitude_rails_helpers.rb,
lib/fortitude/support/instance_variable_set.rb,
lib/fortitude/widget/modules_and_subclasses.rb,
lib/fortitude/widget/start_and_end_comments.rb,
lib/fortitude/rails/yielded_object_outputter.rb,
lib/fortitude/tags/render_widget_placeholder.rb,
lib/fortitude/widget/non_rails_widget_methods.rb,
lib/fortitude/doctypes/html4_tags_transitional.rb,
lib/fortitude/support/class_inheritable_attributes.rb,
lib/rails/generators/fortitude/mailer/mailer_generator.rb,
lib/fortitude/method_templates/simple_compiled_template.rb,
lib/fortitude/widget/widget_class_inheritable_attributes.rb,
lib/rails/generators/fortitude/scaffold/scaffold_generator.rb,
lib/rails/generators/fortitude/base_view/base_view_generator.rb,
lib/rails/generators/fortitude/controller/controller_generator.rb

Overview

Note on handling tags that have no content inside them:

  • If the tag cannot ever have content inside it – a “void tag” as denoted by HTML, specified here by :content_allowed => false – then we can either render it as “<tag>” (if :close_void_tags is set to false, the default, on the widget class), or “<tag/>” (if :close_void_tags is set to true on the widget class).

  • If the tag can have content inside it, but this instance of it does not, then we always render it as <tag></tag> (or <tag attr=“value”…></tag>).

Further, doctypes restrict the values you can set close_void_tags to on a widget: HTML5 allows either, HTML4 requires it to be false, and XHTML requires it to be true.

This is all per the information at:

stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 www.w3.org/TR/xhtml-media-types/#C_2 www.colorglare.com/2014/02/03/to-close-or-not-to-close.html

Defined Under Namespace

Modules: Doctypes, Erector, Errors, Generators, MethodOverriding, MethodTemplates, Rails, Support, Tags, Tilt, Widgets Classes: RenderingContext, Widget

Constant Summary collapse

VERSION =
"0.9.6"

Class Method Summary collapse

Class Method Details

.refine_rails_helpers(on_or_off = :not_specified) ⇒ Object



16
17
18
19
# File 'lib/fortitude/rails/railtie.rb', line 16

def refine_rails_helpers(on_or_off = :not_specified)
  @refine_rails_helpers = !! on_or_off unless on_or_off == :not_specified
  !! @refine_rails_helpers
end