El Friday 16 January 2009 08:52:05 RogueBusinessServices escribió:
> Hello Sergio,
>
> Thank you very much for your reply. However what I am am looking for
> is a multi-select list box. I have tried the code above, but this
> gives me a bunch of checkboxes. I assume that I will have to override
> the subform, but I'm not exactly sure how I can replace only the
> subform for a particular model. I know how to override the
> _form_association.rhtml, but I only want to do it in the particular
> case that this form is called as a subform and for a particular model.

Look at Form Overrides: 
http://wiki.github.com/activescaffold/active_scaffold/form-overrides

You can use a helper method or partial.

>
> Thanks,
>
> Andrew
>
> On Jan 15, 10:28 am, "Sergio Cambra .:: entreCables - Symbol Servicios
>
> Informáticos S.L. ::." <[email protected]> wrote:
> > El Wednesday 14 January 2009 21:34:03 RogueBusinessServices escribió:
> > > Hello,
> > >
> > > I've seen bits of information here and there about how to do this, but
> > > it still isn't clear to me. Perhaps someone could shed some light on
> > > this, or perhaps has some sample code?
> > >
> > > I have a habtm relationship between 2 models, A and B. What I want is
> > > that when I edit a record of type 'A', that I see a form element that
> > > is a list box and it is filled with all of the records of type 'B'.
> > > All of the instances of 'B' that have an association with 'A' would be
> > > selected by default. I would then want to select or de-select items in
> > > that list, and then click on update. When I click on update the habtm
> > > associations would be updated in the database.
> > >
> > > I have found some information on the RoR website about creating my own
> > > partial for something like this. Is this what I would need to do for
> > > ActiveScaffold? Do I need to create my own partial that overrides the
> > > default one for this view? If I do that, where would I need to put
> > > this file and what do I need to name it?
> > >
> > > I also read that when subforms are used that the params[:record]
> > > namespace is different. Are there any 'gotchas' that I need to look
> > > out for when doing this?
> > >
> > > Any help would be greatly appreciated!!
> >
> > class AesController
> >   active_scaffold do |config|
> >     config.columns[:b].form_ui = :select
> >   end
> > end
> >
> > --
> > Sergio Cambra .:: entreCables - Symbol Servicios Informáticos 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]
>
> 


-- 
Sergio Cambra .:: entreCables - Symbol Servicios Informáticos 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
-~----------~----~----~----~------~----~------~--~---

  • Mu... RogueBusinessServices
    • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
      • ... RogueBusinessServices
        • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
          • ... RogueBusinessServices
            • ... RogueBusinessServices
              • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.

Reply via email to