Shawn,

If you're doing something in Rails and it's "not fun" then chances are
you can be doing it a better way!

Using accepts_nested with appropriate relationship declarations will
eliminate going "crazy with all those parameters[][:this][:that]".

I highly recommend you work with accepts_nested.  There are plenty of
resources out there to help you along the way.  It will bring back the
fun.

Matt



On May 7, 7:52 pm, slindsey3000 <[email protected]> wrote:
> I have had the worst time getting my forms to accept input for more
> than one model.  I tried using accepts_nested, and other techniques
> and finally got it all working.  But it was not fun. I never did get
> accepts_nested working!
>
> I do need more experience.
>
> I did hit upon one idea that I just wanted to run by the community.
> Let me know what you think.
>
> If you have one form that will need to send values to several
> models.... how about creating a "Form" model with generic attributes.
> This "Form" model could for example have fields integer1:integer,
> integer2:integer ... etc.. and have fields string1:string,
> string2:string..... etc..
>
> You would build a "Form" model that could handle any form in your
> site.
>
> Then you just collect the values into this "Form" model.. after they
> are in you just assign them to all your other models.  No need to go
> crazy with all those parameters[][:this][:that].
>
> It for sure may not be the MOST efficient way to deal with the
> database, but it can't be that bad.
>
> Thoughts?
>
> Shawn
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" 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 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en.

Reply via email to