>
> Normally I don´t have this requeriment and I define image file_columns
> this way:
> file_column :image, :magick => { :versions => { "thumb"
=>
> "130x150","med" =>
"380x305","gr" => "600x400"} }
>
> Is it posible to access model instance variables in the file_columns
> definition?
sure, you can always replace a string by some erb output
file_column :image, :magick => { :versions => { "thumb" =>
"130x150","med" => "<%= @image.level == 1 ?
"380x305" : "480x405"
%>","gr" => "600x400"} }
would put 380x305 if @image.level is 1 otherwise use "480x405"
There are a lot of ways to do this, depending on your needs.
In the end it''s all text and can be conditionaly replaced with erb
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---