# How to submit two form with one submit tag

**URL:** <https://www.ruby-forum.com/t/how-to-submit-two-form-with-one-submit-tag/130070>\
**Category:** Rails\
**Created:** [February 25, 2008, 5:59am UTC](https://www.ruby-forum.com/t/how-to-submit-two-form-with-one-submit-tag/130070 "2008-02-25T05:59:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [February 25, 2008, 5:59am UTC](https://www.ruby-forum.com/t/how-to-submit-two-form-with-one-submit-tag/130070/1 "2008-02-25T05:59:00Z")

</div>

how to submit two form with one submit tag

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [February 25, 2008, 6:33am UTC](https://www.ruby-forum.com/t/how-to-submit-two-form-with-one-submit-tag/130070/2 "2008-02-25T06:33:02Z")

</div>

Hi Joe,  
Could you be a little more specific and possibly post a code example or  
tell  
is in more detail what you’re trying to achieve?

Cheers,  
James

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [February 25, 2008, 6:48am UTC](https://www.ruby-forum.com/t/how-to-submit-two-form-with-one-submit-tag/130070/3 "2008-02-25T06:48:16Z")

</div>

hi james…

actually i am havng  
this is my first form…

\<%= form\_tag :action =\> ‘create’ %\>

Title: \<%= text\_field 'article', 'title' %\>

Category: \<%= collection\_select(:article,:category\_id,@categories,:id,:name) %\>

Description  
\<%= text\_area 'article', 'description' %\>

-Tag : \<%= text\_field\_tag 'tag\_list' %\> \<%= submit\_tag "Create" %\> \<%= form\_tag %\>

this is second form:

\<% form\_for :article\_cover, :url =\> { :action =\> ‘create’, :id =\> @  
article.id }, :html =\> { :multipart =\> true } do |f| -%\>

\<%= f.file\_field :uploaded\_data %\>

\<%= submit\_tag : create %\>

\<% end -%\>

if i use both forms seperately …it works…but when i combinng them  
…the data s not savng…only null…is comng

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [February 25, 2008, 7:16am UTC](https://www.ruby-forum.com/t/how-to-submit-two-form-with-one-submit-tag/130070/4 "2008-02-25T07:16:59Z")

</div>

hi,  
do this  
\<% form\_for :article\_cover, :url =\> { :action =\> ‘create’, :id =\> @  
article.id }, :html =\> { :multipart =\> true } do |f| -%\>

Title: \<%= text\_field 'article', 'title' %\>

Category: \<%= collection\_select(:article,:category\_id,@categories,:id,:name) %\>

Description  
\<%= text\_area 'article', 'description' %\>

-Tag : \<%= text\_field\_tag 'tag\_list' %\> 

\<%= f.file\_field :uploaded\_data %\>

\<%= submit\_tag : create %\>

\<% end -%\>

On Mon, Feb 25, 2008 at 11:17 AM, joe nayyar [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Description
> 
> \<%= f.file\_field :uploaded\_data %\>
> 
> \> tell is in more detail what you're trying to achieve? \> \> \> \> \>
> 
> >

–  
Thanks & Regards,  
Pavan A.

NOTICE : This transmission contains information that may be confidential  
and  
that may also be privileged. Unless you are the intended recipient of  
the  
message or authorized to receive it for the intended recipient, you may  
not  
copy, forward, or otherwise use it, or disclose it or its contents to  
anyone  
else. If you have received this transmission in error please notify us  
immediately and delete it from your system.
