Really Complex Forums

Following this example of virtual attributes I’d like to go down another
level

http://railscasts.com/episodes/73

In other words create a form that lets a user create a project which has
multiple tasks (tasks have names) which in tern have multiple steps
(with their own attributes)

What does that look like?

project[task][steps][]

Thanks,

Arshak

That’s sounding complex. You might consider using “fields_for” to try
and get to the nesting without such a deep array stack. Look at the
API docs for “fields_for” to get an idea how you might do this.

Ultimately, what I’d do is some trial and error with a debugger in the
action so I could inspect the params hash.

-Danimal

P.S. It looks right, though. Ultimately, you’d end up with a params
hash that would have something like params[:project] => { :task =>
{ :steps => [1,2,3] } } so maybe project[task][steps][] is exactly
what you need.

On Apr 24, 12:34 am, Arshak N. <rails-mailing-l…@andreas-

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs