# Specifying class for form\_remote\_tag

**URL:** <https://www.ruby-forum.com/t/specifying-class-for-form-remote-tag/135298>\
**Category:** Rails\
**Created:** [April 20, 2008, 10:03pm UTC](https://www.ruby-forum.com/t/specifying-class-for-form-remote-tag/135298 "2008-04-20T22:03:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apswartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@apswartz](https://www.ruby-forum.com/u/apswartz)\
**Post date:** [April 20, 2008, 10:03pm UTC](https://www.ruby-forum.com/t/specifying-class-for-form-remote-tag/135298/1 "2008-04-20T22:03:40Z")

</div>

I have a form\_tag that is:  
\<% form\_remote\_tag :url =\> ‘/tasks/new’, :class =\> ‘edit\_task’ do -%\>

Everything is fine EXCEPT the class doesn’t get assigned to the form  
tag. Any help would be appreciated…

Thanks,

Alan

---

<div class="post-metadata">

**Author:** ![apswartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@apswartz](https://www.ruby-forum.com/u/apswartz)\
**Post date:** [April 21, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/specifying-class-for-form-remote-tag/135298/2 "2008-04-21T16:07:15Z")

</div>

Thanks! I had seen that in the docs, but I didn’t know that html  
meant that you could send html options to it. Just a newbie mistake.  
I seem to be making all of them. 🙂

Thanks again for your help. (btw, this doesn’t work for form\_tag for  
anyone else looking for this one.)

–Alan

On Sun, Apr 20, 2008 at 4:00 PM, Frederick C.

---

<div class="post-metadata">

**Author:** ![apswartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@apswartz](https://www.ruby-forum.com/u/apswartz)\
**Post date:** [April 20, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/specifying-class-for-form-remote-tag/135298/3 "2008-04-20T23:01:26Z")

</div>

On Apr 20, 9:02 pm, “Alan S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a form\_tag that is:  
> \<% form\_remote\_tag :url =\> ‘/tasks/new’, :class =\> ‘edit\_task’ do -%\>
> 
> Everything is fine EXCEPT the class doesn’t get assigned to the form  
> tag. Any help would be appreciated…

Take a look at the docs: any html options need to be passed as :html  
=\> { …}

Fred

---

<div class="post-metadata">

**Author:** ![apswartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@apswartz](https://www.ruby-forum.com/u/apswartz)\
**Post date:** [April 21, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/specifying-class-for-form-remote-tag/135298/4 "2008-04-21T16:13:09Z")

</div>

On 21 Apr 2008, at 15:06, Alan S. wrote:

> Thanks! I had seen that in the docs, but I didn’t know that html  
> meant that you could send html options to it. Just a newbie mistake.  
> I seem to be making all of them. 🙂
> 
> Thanks again for your help. (btw, this doesn’t work for form\_tag for  
> anyone else looking for this one.)

form\_tag is unfortunately different. You need  
form\_tag( {:action =\> …, :controller =\> …}, :class =\> 'foo)  
It would be nice if this was consistent across the various helpers,  
but unfortunately it isn’t

Fred.
