Module: InlineHelper

Defined in:
app/helpers/inline_helper.rb

Instance Method Summary collapse

Instance Method Details

#phrase(*args) ⇒ Object

Normal phrase phrase(“headline”, url: www.infinum.co/yabadaba, inverse: true, scope: “models.errors”) Data model phrase phrase(record, :title, inverse: true, class: phrase-record-title)



7
8
9
10
11
12
13
14
15
# File 'app/helpers/inline_helper.rb', line 7

def phrase(*args)
  if args[0].class.in? [String, Symbol]
    key, options = args[0].to_s, (args[1] || {})
    inline(phrasing_extract_record(key, options), :value, options)
  else
    record, attribute, options = args[0], args[1], args[2]
    inline(record, attribute, options || {})
  end
end