Module: ShowFor

Defined in:
lib/show_for.rb,
lib/show_for/label.rb,
lib/show_for/helper.rb,
lib/show_for/version.rb,
lib/show_for/builder.rb,
lib/show_for/content.rb,
lib/show_for/attribute.rb,
lib/show_for/association.rb,
lib/generators/show_for/install_generator.rb

Defined Under Namespace

Modules: Association, Attribute, Content, Generators, Helper, Label Classes: Builder

Constant Summary

VERSION =
"0.2.4".freeze
@@show_for_tag =
:div
@@label_tag =
:strong
@@label_class =
:label
@@separator =
"<br />"
@@content_tag =
nil
@@content_class =
:content
@@blank_content_class =
"blank"
@@wrapper_tag =
:p
@@wrapper_class =
:wrapper
@@collection_tag =
:ul
@@collection_class =
:collection
@@default_collection_proc =
lambda { |value| "<li>#{ERB::Util.html_escape(value)}</li>".html_safe }
@@i18n_format =
:default
@@association_methods =
[ :name, :title, :to_s ]
@@label_proc =
nil

Class Method Summary (collapse)

Class Method Details

+ (Object) setup {|_self| ... }

Yield self for configuration block:

ShowFor.setup do |config|
  config.i18n_format = :long
end

Yields:

  • (_self)

Yield Parameters:

  • _self (ShowFor)

    the object that the method was called on



57
58
59
# File 'lib/show_for.rb', line 57

def self.setup
  yield self
end