Forum: Ruby on Rails How can you get a variable from the view into the model

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2258c43182638a619920180e9e7de5bf?d=identicon&s=25 fernando (Guest)
on 2007-07-16 22:34
(Received via mailing list)
Hi,

I am using the attachment_fu plugin to generate thumbnails and save
images into the file system. I want to create a folder in public/
images and then save all the images including thumbanils there.
So far I can create a new folder and save images. However, I cannot
save the images into a specific subfolder.
I want to create a variable and set it as using a text field in the
view, then upload files into a folder named after whatever is in the
text field. using attachemtn_fu the save path is set using:

def full_filename(thumbnail = nil)
  file_system_path = (thumbnail ? thumbnail_class :
self).attachment_options[:path_prefix].to_s
  File.join(RAILS_ROOT, file_system_path,
*partitioned_path(thumbnail_name_for(thumbnail)))
end

Does anyone know how I can get a variable from the view inbetween
'attachment_options[:path_prefix]' and 'to_s' in the model?

kind regards

Tim Fernandez
This topic is locked and can not be replied to.