Thanks a ton the templat*e *worked perfectly. I end up using it to set both the items the owner and the project from session vars. Below is the code that worked for me along with some other field tweaks to the input-many for my form.
<input-many template="&Locmathist.new(:field_tech => @current_user, :project => @current_project)"> Bob On Thursday, March 8, 2012 4:05:48 PM UTC-5, Bob Sleys wrote: > > I need to init a field in that is filled out via an input-many tag. The > thing is I can't init it in the model because the init value comes from a > session variable. I tired using a new_for_model method in the models > controller but that doesn't seem to be being called. I also though about > doing it in the dryml but then I ended up over riding the records value in > already existing records. > > Any ideas? > > On a related note I have another field in the same <input-many> tag that I > wanted to use :creator => true on the relationship. But when I include the > field in the form it isn't defaulting to the current user. > > Here is the relationship as defined in the model > > belongs_to :field_tech, :class_name => "User", :creator => true, > :conditions => "employee = 't'" > > Bob > -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/hobousers/-/Njxqh0CI3-QJ. 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.
