I have a model with the following relations (code abbreviated)

class Shoot < ActiveRecord::Base

  has_many :slates

end


class Slate
   belongs_to shoot
   has_many takes
end

class Take
  belongs_to slate
end


In slate show, I have an inplace editor thus:



<show-page>
  <collection: replace>
  <table-plus:takes fields="this, raw_filename, stills, movie, slate,
image_sequence">
        <stills-view:><if test="&this_parent.stills"><image
src="&this_parent.summary_image" width="200"
alt="&this_parent.raw_filename" /></if></stills-view:>
        <controls:/>
        <slate-view:><editor  /></slate-view:>
  </table-plus>
  </collection:>

</show-page>

And the select control shows all the slates in the table.
I want it to just show the slates that belong to the same shoot.
I've tried two ways:

1) add  options="&this.shoot.slates" to the editor tag.
This results in the correct list, but selecting a new slate to change
the belongs to just results in a null slate_id (and a lost take).

2) add a 'conditions' clause to the belongs_to association of the
take.
:conditions=>"shoot_id = #{slate.shoot.id}"

which gives me
  undefined local variable or method `slate' for #<Class:
0x7f267ceb62f8>

So, any suggestions are more than welcome..

Thanks in advance.

Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to