Inline formsets?


I’m new to Rails (I’m comming from Django) and I’m looking for
something equivalent to Django’s Formsets (http://
Formsets | Django documentation | Django) and Inline
Formsets (Creating forms from models | Django documentation | Django

does Rails have anything like this?

for those who don’t know Django, a formset is an html form that
represents several records at once, like this:

given an Article, a formset with 3 items would be like:

Title: Pub date: Title: Pub date: Title: Pub date: ....

(please, ignore the clutter. just the INPUT tags matter)

and when the request is submitted, I just have to do this in my
controller to get it parsed:

ArticleFormSet = formset_factory(ArticleForm)
if request.method == ‘POST’:
formset = ArticleFormSet(request.POST)

(now, the formset object has a list of 3 Article objects)

thanks in advance,


Hello, Cesar.

I started to learn Django and I’ Ruby developer. Unfortunately Rails
doesn’t have something familiar out of the box. And you have to
implement this from scratch. I recommend to use form objects fro this
(again Rails doesn’t provide them, so you have to implement them from
scratch by yourself). Check out this railscast to be introduced to the
subject: #416 Form Objects (pro) - RailsCasts

PS. Table in the view template should be written manually.