Method: Alchemy::Ingredient#preview_text

Defined in:
app/models/alchemy/ingredient.rb

#preview_text(maxlength = 30) ⇒ Object

The first 30 characters of the value

Used by the Element#preview_text method.

Parameters:

  • max_length (Integer)

    (30)



117
118
119
# File 'app/models/alchemy/ingredient.rb', line 117

def preview_text(maxlength = 30)
  value.to_s[0..maxlength - 1]
end