# Forms help

**URL:** <https://www.ruby-forum.com/t/forms-help/128728>\
**Category:** Rails\
**Created:** [February 11, 2008, 2:37am UTC](https://www.ruby-forum.com/t/forms-help/128728 "2008-02-11T02:37:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 2:37am UTC](https://www.ruby-forum.com/t/forms-help/128728/1 "2008-02-11T02:37:18Z")

</div>

Ok, so in the middle of learning Ruby, things jumped to 2.0.2 and now  
i’m having to relearn. I can’t find any answers on this.

in new.rhtml.erb I have the following code:

\<%= error\_messages\_for :failure %\>

\<% form\_for(@failure) do |f| %\>  
\<%= render :partial =\> “form”, :locals =\> { :f =\> f, :button =\>  
“Create” } %\>  
\<% end %\>

–

I created a new file named: \_form.rhtml.rb and and have the following:

**Bus unit**  
 \<%= f.text\_field :bus\_unit %\>

**Pro num**  
 \<%= f.text\_field :pro\_num %\>

**Ship num**  
 \<%= f.text\_field :ship\_num %\>

**Rbna num**  
 \<%= f.text\_field :rbna\_num %\>

–

Basically I moved what was automatically generated by the scaffolding  
to the new file \_form.rhtml.erb. I did this because I plan on  
changing the “Bus Unit” to a drop down box with 3 options. Everything  
I’ve found suggest that this is how I need to do it. However, I get  
the following error:

Couldn’t find template file for failures/\_form in [“C:/apps/yrcsphere/  
app/views”]

(If you want, you can find more at [http://athel.homeftp.net/failures/new](http://athel.homeftp.net/failures/new)  
).

What am I doing wrong? Where can I find any documentation on  
scaffolding/rails and making forms?

Thanks

~Athel

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 3:20am UTC](https://www.ruby-forum.com/t/forms-help/128728/2 "2008-02-11T03:20:03Z")

</div>

On 2/10/08, Athel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> “Create” } %\>  
> \<% end %\>
> 
> –
> 
> I created a new file named: \_form.rhtml.rb and and have the following:

## Is that a typo? It should be \_form.html.erb

Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 3:23am UTC](https://www.ruby-forum.com/t/forms-help/128728/3 "2008-02-11T03:23:34Z")

</div>

Yes, its a typo, sorry, I have it named \_form.rhtml.erb

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 3:32am UTC](https://www.ruby-forum.com/t/forms-help/128728/4 "2008-02-11T03:32:22Z")

</div>

On 2/10/08, Athel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Yes, its a typo, sorry, I have it named \_form.rhtml.erb

Okay, so directory is it in, and what’s the controller?

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 3:46am UTC](https://www.ruby-forum.com/t/forms-help/128728/5 "2008-02-11T03:46:30Z")

</div>

its in the directory of:

C:\apps\yrcsphere\app\views\failures

and the controller is

C:\apps\yrcsphere\app\controllers\failures\_controller.rb

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/forms-help/128728/6 "2008-02-11T18:36:33Z")

</div>

On 11 Feb 2008, at 02:22, Athel wrote:

> Yes, its a typo, sorry, I have it named \_form.rhtml.erb

That’s still wrong. \_form.html.erb is what it should be

Fred

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/forms-help/128728/7 "2008-02-11T14:51:47Z")

</div>

On 2/10/08, Athel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> its in the directory of:
> 
> C:\apps\yrcsphere\app\views\failures
> 
> and the controller is
> 
> C:\apps\yrcsphere\app\controllers\failures\_controller.rb

Hmm, that all sounds right to me. I’d suggest checking permissions on  
the file, but since I see you’re on Windows, I’m not sure that makes  
sense either.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/forms-help/128728/8 "2008-02-11T19:44:21Z")

</div>

I am so sorry. That fixed it. When you said typo, I checked my  
original post and was missing the e in \*erb. Renaming it to  
\_form.html.erb completely fixed it.

Thank you all.

---

<div class="post-metadata">

**Author:** ![athel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/839c29/32.png) [@athel](https://www.ruby-forum.com/u/athel)\
**Post date:** [February 11, 2008, 6:55pm UTC](https://www.ruby-forum.com/t/forms-help/128728/9 "2008-02-11T18:55:27Z")

</div>

On 2/11/08, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Yes, its a typo, sorry, I have it named \_form.rhtml.erb
> 
> That’s still wrong. \_form.html.erb is what it should be

Good catch Fred, I’d assumed he was saying that it was named as I’d  
suggested.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
