Thanks, works like expected. I added

   def conditions_for_collection
     ['contract_versions.version  <> ?', 1]
   end

to the controller of the versioned model (Contractversion)

Obviously I need to replace '1' with the current version number stored  
in the Contract record.
Being new at Rails, how does the Contractversion controller know which  
Contract clicked on the "Version" link, i.e. how do I get the ID of  
the parent (the caller) ?

Thanks
Andreas



On Jan 27, 2009, at 6:05 PM, Sergio Cambra .:: entreCables - Symbol  
Servicios Informáticos S.L. ::. wrote:

>
> El Monday 26 January 2009 13:49:11 Kumala escribió:
>> I am using activescaffold and acts_as_versioned.
>> I have 2 models: contract and contractversion. I have added a
>> "Versions" link to my scaffold using:
>>    config.nested.add_link("Versions", [:contractversions])
>>
>> Unfortunately, when clicking on the "Versions" link in the contract
>> model, it shows all contract versions, including the current contract
>> values.
>>
>> How can I prevent the latest version from being shown?
>
> You can put conditions for the find method defining a
> conditions_for_collection method.
>
> -- 
> Sergio Cambra .:: entreCables S.L. ::.
> Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
> T) 902 021 404 F) 976 52 98 07 E) [email protected]
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

  • Ac... Kumala
    • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
      • ... Andreas Eckert
        • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
          • ... Andreas Eckert
            • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
              • ... Andreas Eckert
                • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
                • ... Tys von Gaza

Reply via email to