Ok so I have this model...
class Asset < ActiveRecord::Base
attr_accessible :asset_file_name, :lesson_id, :attachment
has_attached_file :attachment,
:url => "/attachments/:id/:basename.:extension",
:path => ":rails_root/public/attachments/:id/:basename.:extension"
validates_presence_of :asset_file_name
validates_attachment_presence :attachment
end
(also have a model for Lesson)
I want to save attachments to /attachments/:lesson_id/:basename.:extension.
That is not to the :id of the asset but the :lesson_id. When I do this the directory is actually just named :lesson_id. Anyone know how to get the actual lesson_id? I've also tried @asset.lesson_id.