# Sumit\_tag

**URL:** <https://www.ruby-forum.com/t/sumit-tag/193987>\
**Category:** Rails\
**Created:** [August 27, 2010, 3:45pm UTC](https://www.ruby-forum.com/t/sumit-tag/193987 "2010-08-27T15:45:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [August 27, 2010, 3:45pm UTC](https://www.ruby-forum.com/t/sumit-tag/193987/1 "2010-08-27T15:45:03Z")

</div>

hii all,  
i don’t know how to ask this question because am new to  
rails.  
but i want to know to is which part of code sumit\_tag will take you  
means  
after execution of sumit\_tag where control of programme goes??

---

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [August 27, 2010, 3:52pm UTC](https://www.ruby-forum.com/t/sumit-tag/193987/2 "2010-08-27T15:52:46Z")

</div>

Amit T. wrote:

> hii all,  
> i don’t know how to ask this question because am new to  
> rails.  
> but i want to know to is which part of code sumit\_tag will take you  
> means  
> after execution of sumit\_tag where control of programme goes??

---

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [August 27, 2010, 4:32pm UTC](https://www.ruby-forum.com/t/sumit-tag/193987/3 "2010-08-27T16:32:49Z")

</div>

Amit T. wrote:

> hii all,  
> i don’t know how to ask this question because am new to  
> rails.  
> but i want to know to is which part of code sumit\_tag will take you  
> means  
> after execution of sumit\_tag where control of programme goes??

Do you understand how HTML forms work in general? If so, the answer  
should be obvious (hint: the submit\_tag has nothing to do with it); also  
look at form\_for and form\_tag.

If you don’t understand how HTML forms work in general, then you’re not  
ready to be developing Web applications yet. Read through a good HTML  
reference, then come back. Good luck!

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [August 27, 2010, 4:42pm UTC](https://www.ruby-forum.com/t/sumit-tag/193987/4 "2010-08-27T16:42:41Z")

</div>

On 27 August 2010 15:32, Marnen Laibow-Koser [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> look at form\_for and form\_tag.
> 
> If you don’t understand how HTML forms work in general, then you’re not  
> ready to be developing Web applications yet. Read through a good HTML  
> reference, then come back. Good luck!

Whilst I agree with Marnen, if you are using Rails as a way of  
learning about the whole concept of web applications and am therefore  
learning about html, css, javascript, SQL and Rails at the same time,  
then whilst working through an html reference and tutorials have a  
look at the Rails Guides at [http://guides.rubyonrails.org/](http://guides.rubyonrails.org/). Start  
with Getting Started obviously. Playing with Rails at the same time  
as learning the more tedious (but necessary) details of html will make  
your life more enjoyable.

Colin

---

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [August 27, 2010, 9:53pm UTC](https://www.ruby-forum.com/t/sumit-tag/193987/5 "2010-08-27T21:53:01Z")

</div>

On 27 August 2010 14:52, Amit T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Amit T. wrote:
> 
> > hii all,  
> > i don’t know how to ask this question because am new to  
> > rails.  
> > but i want to know to is which part of code sumit\_tag will take you  
> > means  
> > after execution of sumit\_tag where control of programme goes??

A submit\_tag goes inside a form, for example:

\<%= form\_tag :controller =\> ‘votes’, :action =\> ‘create’ do %\>  
\<%= submit\_tag %\>  
\<% end %\>

This generates HTML like:

So when you press that submit button, your browser POSTs to the  
‘/votes/create’ URL.

When Rails receives that request, it turns the URL into a controller  
and an action, based on the rules in your config/routes.rb. In this  
case it goes to the action/method called ‘create’ in VotesController.

Chris
