Can I get available photo styles in Paperclip?

Viewed 753

I have some different styles(sizes), so I want to echo all of them near the text editor for user to choose one and use in the text.

To do this, I need to get all defined styles in model. How can I do this? (I need an automated way, because styles may change)

  # Photo
  has_attached_file :photo, :styles => { 
    :sthumb => "150x150>",
    :crop => "200x200#",
    :thumb => "300x300>",
    :small => "500x500>", 
    :large => "900x900>",
    :xlarge => "2600x2600>"
    }, 
  :default_url => "missing.png",
  :url => "/items/:id/:style.:basename.:extension"
1 Answers
Related