Is there a way to access a nested objects parent from within that
objects model before it is saved (so I have no ID set yet)?

in artwork.rb:
   has_many artwork_attachment
   accepts_nested_attributes_for :artwork_attachment, :allow_destroy
=> true

artwork_controller.rb's new action includes Artwork.new and
artwork_attachment.build

The problem I have is that in artwork_attachment.rb I have some code
that resets the size of the paperclip attachments based on information
associated with artwork (actually artwork belongs_to line_item which
has_one product and the product has specific dimension). So how can I
refer to the parent of a nested resource before it is actually saved
and gets given an ID?

Thanks
Ewen

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to