RubyOnRails
RubyOnRails

Reputation: 235

form_tag inside a form_tag - In rails

I wanted to use two form_tag in rails like this,

<%= form_tag %>

    <%= form_tag %>
    ................
    <%= submit_tag %>

<% submit_tag %>

But the action for inside form_tag taking first form_tag's action...!!! For both form_tag assign the different action?

Upvotes: 2

Views: 1955

Answers (2)

MZaragoza
MZaragoza

Reputation: 10111

what you need is called *Nested Forms * take a look at the rails cast #196 Nested Model Form Part 1

Here is a link to a gem that you can use to help you out https://github.com/ryanb/nested_form

Upvotes: 1

Simone Carletti
Simone Carletti

Reputation: 176552

HTML does not allow nested forms, thus it's reasonable that the helpers are not designed to support nesting.

Upvotes: 5

Related Questions