# Problem while i submit the form

**URL:** <https://www.ruby-forum.com/t/problem-while-i-submit-the-form/157981>\
**Category:** Rails\
**Created:** [January 17, 2009, 9:35am UTC](https://www.ruby-forum.com/t/problem-while-i-submit-the-form/157981 "2009-01-17T09:35:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [January 17, 2009, 9:35am UTC](https://www.ruby-forum.com/t/problem-while-i-submit-the-form/157981/1 "2009-01-17T09:35:55Z")

</div>

Hi  
In my form i m using link\_to helper to pass the user\_id and  
user\_type.like below i used  
\<%= link\_to(‘assign’,{ :action =\> :privilege\_assign,:id =\> user.id,  
:type =\> “1” } ) -%\>  
it passes like below  
[http://192.168.0.82:3000/users/privileg](http://192.168.0.82:3000/users/privileg) â€¦ n/2?type=1

when i click assign link it passes user\_id and user\_type correctly.

in that assign.rhtml i have field like

\<% form\_for :profile,  
@profile,  
:url =\> { :action =\> ‘privilege\_assign’ } do |f| %\>  
Profile :   
\<%= text\_field\_with\_auto\_complete :profile, :name, { :size =\> 24} %\>

\<%=flash[:notice]%\>

\<%= submit\_tag ‘’, :class =\> ‘SubmitButton’ %\>

when the user enters submit button without entering any value into the  
field  
the flash notice message will be displayed.then if he enters value into  
the field and he click the submit button it passes only user\_id .it  
doesnot passing the user\_type.  
it passes like below  
[http://192.168.0.82:3000/users/privilege\_assign/2](http://192.168.0.82:3000/users/privilege_assign/2)

why it happens pls help me

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [January 17, 2009, 12:20pm UTC](https://www.ruby-forum.com/t/problem-while-i-submit-the-form/157981/2 "2009-01-17T12:20:03Z")

</div>

On 17 Jan 2009, at 08:35, Newb N. wrote:

> \<%= submit\_tag ‘’, :class =\> ‘SubmitButton’ %\>

That’s normal. Forms post their contents by default and so those  
parameters don’t show up in the url.

Fred

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [January 17, 2009, 12:26pm UTC](https://www.ruby-forum.com/t/problem-while-i-submit-the-form/157981/3 "2009-01-17T12:26:44Z")

</div>

Frederick C. wrote:

> On 17 Jan 2009, at 08:35, Newb N. wrote:
> 
> > \<%= submit\_tag ‘’, :class =\> ‘SubmitButton’ %\>
> 
> That’s normal. Forms post their contents by default and so those  
> parameters don’t show up in the url.
> 
> Fred

could u say me the alternative

regards  
newb
