Skip to content
Squeegy edited this page Sep 12, 2010 · 5 revisions

You need to let your model know it should be Fleximage friendly. Lets say you have a model for photos.

# app/models/photo.rb
class Photo < ActiveRecord::Base
  acts_as_fleximage :image_directory => 'public/images/uploaded_photos'
end

The :image_directory option tells the plugin where to store your master images. This value is relative to your application root, and doesn’t need to be in your public directory if you don’t want it to be. This is where the source images will be that all your templates start with.

There are many other options for your model. Refer to the list of ModelClassAccessors more information on all class level options.

Note that this illustrates how to store images using the filesystem, the recommended approach. If you really want DB storage, check out the DatabaseOrFilesystemStorage page.

Next: UploadForm

Clone this wiki locally