# Button

**URL:** <https://www.ruby-forum.com/t/button/182216>\
**Category:** Rails\
**Created:** [January 25, 2010, 9:30am UTC](https://www.ruby-forum.com/t/button/182216 "2010-01-25T09:30:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 25, 2010, 9:30am UTC](https://www.ruby-forum.com/t/button/182216/1 "2010-01-25T09:30:27Z")

</div>

Hi  
I have  
Create

```
Could anybody say get the same above using railshelper I tried

```

f.submit “Create”,:class =\> ‘class1’ But not correct

Thanks  
Tom

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 25, 2010, 12:44pm UTC](https://www.ruby-forum.com/t/button/182216/2 "2010-01-25T12:44:25Z")

</div>

2010/1/25 Tom M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hi  
> I have  
> Create
> 
> Could anybody say get the same above using railshelper I tried
> 
> f.submit “Create”,:class =\> ‘class1’ But not correct

What is not correct about it? What does it generate? If you get an  
error show us the code around it.

Colin

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 25, 2010, 1:18pm UTC](https://www.ruby-forum.com/t/button/182216/3 "2010-01-25T13:18:50Z")

</div>

Colin L. wrote:

> 2010/1/25 Tom M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > Hi  
> > ï¿½ I have  
> > Create

Not an error f.submit creates the html as

But what I need is exactly  
Create

```
If directly use this no problem But what I ould like to know an 

```

alternative in railshelper

Tom

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 25, 2010, 4:03pm UTC](https://www.ruby-forum.com/t/button/182216/4 "2010-01-25T16:03:19Z")

</div>

Tom M. wrote:

> Colin L. wrote:
> 
> > 2010/1/25 Tom M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> > 
> > > Hi  
> > > ï¿½ I have  
> > > Create
> 
> Not an error f.submit creates the html as
> 
> But what I need is exactly  
> Create
> 
> ```
> If directly use this no problem But what I ould like to know an 
> 
> ```
> 
> alternative in railshelper
> 
> Tom

You also have button\_tag but this won’t create an html tag, it  
does though create a simple form wrapped around an input which means  
your backend gets a consistent result regardless of the browser  
( is a bit inconsistent depending on the users browser).

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 25, 2010, 4:04pm UTC](https://www.ruby-forum.com/t/button/182216/5 "2010-01-25T16:04:29Z")

</div>

> You also have button\_tag but this won’t create an html tag, it  
> does though create a simple form wrapped around an input which means  
> your backend gets a consistent result regardless of the browser  
> ( is a bit inconsistent depending on the users browser).

oops i meant button\_to …

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 25, 2010, 11:25pm UTC](https://www.ruby-forum.com/t/button/182216/6 "2010-01-25T23:25:03Z")

</div>

Tom M. wrote:

> Hi  
> I have  
> Create
> 
> ```
> Could anybody say get the same above using railshelper I tried
> 
> ```
> 
> f.submit “Create”,:class =\> ‘class1’ But not correct

Try content\_tag – or just write the literal HTML.

> Thanks  
> Tom

## Best,

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

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 26, 2010, 1:38am UTC](https://www.ruby-forum.com/t/button/182216/7 "2010-01-26T01:38:59Z")

</div>

Have you tried:  
:html=\>{:id =\> ‘submit’,:class=\>‘calss1’}

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 26, 2010, 4:40am UTC](https://www.ruby-forum.com/t/button/182216/8 "2010-01-26T04:40:26Z")

</div>

works with my submit\_to\_remote.

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [January 26, 2010, 1:45am UTC](https://www.ruby-forum.com/t/button/182216/9 "2010-01-26T01:45:24Z")

</div>

Chris H. wrote:

> Have you tried:  
> :html=\>{:id =\> ‘submit’,:class=\>‘calss1’}

That won’t do it. The solutions I provided are the only correct ones.

## Best,

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