On Tuesday, October 20, 2015 at 3:12:14 AM UTC-5, Sergio Cambra wrote: > > El Lunes, 19 de octubre de 2015 22:13:34 [email protected] <javascript:> > escribió: > > > The existing Manufacturers populate the HTML select drop down, but I have > > > not found a way to set the Manufacturer parent. Merely selecting the > > > associated parent in the drop down leaves the relationship empty when I > > > commit with the `Create` button. If I click the `Replace Existing` link > > > after selecting a Manufacturer an empty new Product is added without me > > > using the `Create` button. It's empty even if I've already populated Name > > > and Part Number. After clicking the link the manufacturer name and > > > abbreviation fields are left empty and when I do hit create, the > associate > > > is still empty. > > > > > > < > https://lh3.googleusercontent.com/-44RMGKtdplw/ViXNK27yWxI/AAAAAAAAKlo/8P6W > > > G7cO0GE/s1600/failing_to_associate.png> > > > > > > > > > Is it a hint that the `Replace With New` and `Replace Existing` font > > > appears unformatted? > > > > > > Thanks much, > > > Rob > > > > If you want to select always an existing manufacturer, do this: > > > > class ProductsController < ApplicationController > > active_scaffold :"product" do |conf| > > conf.columns[:manufacturer].form_ui = :select > > end > > end > > > > If you want to be able to create new manufacturer or select an existing > one, left controller as is. Then select manufacturer and click replace > existing. > > > > Let me know if that doesn't work. > > > > Replace with new shouldn't create a empty product, if doing that, it's a > bug. It only should clear manufacturer subform. >
Thanks much. Since I only want to be able to select existing manufacturers, adding the config above works just fine for me. I do believe there is something amiss when left to defaults and you try to use an existing manufacturer. If any further information would help, please let me know. -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails Gem" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/activescaffold. For more options, visit https://groups.google.com/d/optout.
