# A simple form

**URL:** <https://www.ruby-forum.com/t/a-simple-form/177204>\
**Category:** Rails\
**Created:** [October 13, 2009, 10:40am UTC](https://www.ruby-forum.com/t/a-simple-form/177204 "2009-10-13T10:40:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 13, 2009, 10:40am UTC](https://www.ruby-forum.com/t/a-simple-form/177204/1 "2009-10-13T10:40:05Z")

</div>

I’m a bit confused on how to write a simple form. But not a form\_tag and  
not using RESTful.

I would like to be able to design without RESTful design. I’ve used it a  
bit but don’t see the point. It’s complicating things, at least for me.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 13, 2009, 10:49am UTC](https://www.ruby-forum.com/t/a-simple-form/177204/2 "2009-10-13T10:49:35Z")

</div>

2009/10/13 PÃ¥l BergstrÃ¶m [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I’m a bit confused on how to write a simple form. But not a form\_tag and  
> not using RESTful.

form\_tag _is_ the way to do a simple form. What do you want to do  
that form\_tag does not do (or what does it do that you do not want it  
to)? Are you confusing it with form\_for?

Colin

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 13, 2009, 11:07am UTC](https://www.ruby-forum.com/t/a-simple-form/177204/3 "2009-10-13T11:07:17Z")

</div>

Colin L. wrote:

> 2009/10/13 PÃ¥l BergstrÃ¶m [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > I’m a bit confused on how to write a simple form. But not a form\_tag and  
> > not using RESTful.
> 
> form\_tag _is_ the way to do a simple form. What do you want to do  
> that form\_tag does not do (or what does it do that you do not want it  
> to)? Are you confusing it with form\_for?
> 
> Colin

Yes. How do I write it forms that is not RESTful? I mean not form\_tag. I  
still want to bind a form to an object. How do I write this in a  
non-restful way?

\<% form\_for :article, @article, :url =\> { :action =\> “create” }, :html  
=\> {:class =\> “nifty\_form”} do |f| %\>

Is it:

\<% form\_for :action =\> “create” %\>  
\<%= text\_field “model”, “test” %\>  
\<% end %\>

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 13, 2009, 11:34am UTC](https://www.ruby-forum.com/t/a-simple-form/177204/4 "2009-10-13T11:34:39Z")

</div>

2009/10/13 PÃ¥l BergstrÃ¶m [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > Colin
> 
> Yes. How do I write it forms that is not RESTful? I mean not form\_tag. I  
> still want to bind a form to an object. How do I write this in a  
> non-restful way?
> 
> \<% form\_for :article, @article, :url =\> { :action =\> “create” }, :html  
> =\> {:class =\> “nifty\_form”} do |f| %\>

What do you mean by not RESTful? What does the above do or not for  
you that is not what you want?

Colin

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 13, 2009, 2:09pm UTC](https://www.ruby-forum.com/t/a-simple-form/177204/5 "2009-10-13T14:09:47Z")

</div>

2009/10/13 PÃ¥l BergstrÃ¶m [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Not sure 🙂 I thought it was. I guess I’ll use a regular form\_tag then.

I still don’t understand why you can’t use form\_for if you have an  
object that the form is bound to, that is exactly what form\_for does.

Colin

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 13, 2009, 1:02pm UTC](https://www.ruby-forum.com/t/a-simple-form/177204/6 "2009-10-13T13:02:07Z")

</div>

Colin L. wrote:

> 2009/10/13 PÃ¥l BergstrÃ¶m [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> What do you mean by not RESTful? What does the above do or not for  
> you that is not what you want?
> 
> Colin

Not sure 🙂 I thought it was. I guess I’ll use a regular form\_tag then.
