Skip to content

Commit

Permalink
#20 show_for config added
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdilek committed Sep 10, 2013
1 parent ca81bb4 commit 7c1f307
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
38 changes: 38 additions & 0 deletions config/initializers/show_for.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Use this setup block to configure all options available in ShowFor.
ShowFor.setup do |config|
# The tag which wraps show_for calls.
# config.show_for_tag = :div

# The tag which wraps each attribute/association call. Default is :p.
# config.wrapper_tag = :dl

# The tag used to wrap each label. Default is :strong.
# config.label_tag = :dt

# The tag used to wrap each content (value). Default is nil.
# config.content_tag = :dd

# The DOM class set for blank content tags. Default is "blank".
# config.blank_content_class = 'no_content'

# The separator between label and content. Default is "<br />".
# config.separator = "<br />"

# The tag used to wrap collections. Default is :ul.
# config.collection_tag = :ul

# The default iterator to be used when invoking a collection/association.
# config.default_collection_proc = lambda { |value| "<li>#{value}</li>" }

# The default format to be used in I18n when localizing a Date/Time.
# config.i18n_format = :default

# Whenever a association is given, the first method in association_methods
# in which the association responds to is used to retrieve the association labels.
# config.association_methods = [ :name, :title, :to_s ]

# If you want to wrap the text inside a label (e.g. to append a semicolon),
# specify label_proc - it will be automatically called, passing in the label text.
# config.label_proc = lambda { |l| l + ":" }
config.label_class = 'label label-danger'
end
5 changes: 5 additions & 0 deletions config/locales/show_for.en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
en:
show_for:
blank: "Not specified"
"yes": "Yes"
"no": "No"
5 changes: 5 additions & 0 deletions config/locales/show_for.tr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tr:
show_for:
blank: "Belirtilmemiş"
"yes": "Evet"
"no": "Hayır"

0 comments on commit 7c1f307

Please sign in to comment.