Class: Ecm::Pictures::Picture
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ecm::Pictures::Picture
- Extended by:
- FriendlyId
- Defined in:
- app/models/ecm/pictures/picture.rb
Instance Method Summary collapse
- #display_code(style) ⇒ Object
- #display_code_for_erb ⇒ Object
- #display_code_for_textile ⇒ Object
- #human ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#display_code(style) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'app/models/ecm/pictures/picture.rb', line 46 def display_code(style) case style when :erb "<%= render_picture '#{name}' %>" when :textile "!#{image.url}!".gsub(/(\?[0-9]{1,})/, '') end end |
#display_code_for_erb ⇒ Object
38 39 40 |
# File 'app/models/ecm/pictures/picture.rb', line 38 def display_code_for_erb display_code(:erb) end |
#display_code_for_textile ⇒ Object
42 43 44 |
# File 'app/models/ecm/pictures/picture.rb', line 42 def display_code_for_textile display_code(:textile) end |
#human ⇒ Object
59 60 61 |
# File 'app/models/ecm/pictures/picture.rb', line 59 def human name end |
#to_s ⇒ Object
55 56 57 |
# File 'app/models/ecm/pictures/picture.rb', line 55 def to_s name end |