Christian Fazzini
unread,Oct 2, 2010, 12:52:27 PM10/2/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Paperclip Plugin
My form submits with a column called stream_type, which can either be
"full", "30secs" or "90secs".
How can i set it so that it sets has_attached_file according to the
form value stream_type?
--------------
Model class looks like this:
has_attached_file :media,
:styles => { :original =>
<need_to_set_dynamic_content_here> },
:url => '/assets/artists/:artist_id/
songs/:id/:style.:extension',
:path => ':rails_root/public/assets/
artists/:artist_id/songs/:id/:style.:extension',
:processors => [:process_audio]
--------------
So for example, if my form submits with stream_type = 90secs, then
has_attached_file will look like:
has_attached_file :media,
:styles => { :original => '30' },
:url => '/assets/artists/:artist_id/
songs/:id/:style.:extension',
:path => ':rails_root/public/assets/
artists/:artist_id/songs/:id/:style.:extension',
:processors => [:process_audio]