# Form\_helpers?

**URL:** <https://www.ruby-forum.com/t/form-helpers/98597>\
**Category:** Rails\
**Created:** [July 16, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/form-helpers/98597 "2006-07-16T18:40:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/1 "2006-07-16T18:40:55Z")

</div>

Just a quick silly question , are form\_helpers actually helper.rb files  
?

Stuart

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/2 "2006-07-16T18:53:52Z")

</div>

> Just a quick silly question , are form\_helpers actually helper.rb files ?  
> If you mean are they in ruby source then yeah. You can have a look at  
> the source in somewhere like:  
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_view/helpers/  
> (depending on your install).

You should find all of the code for rails in the gems folders - great  
place to look to understand how it all works.

Steve

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 7:06pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/3 "2006-07-16T19:06:15Z")

</div>

I’m sorry, Im reading about them in AWDWR and have started to read  
through the API docs. What I wanted to know is the code part of the  
helper files -\> app\helpers or part of the .rhtml pages ?

Stuart

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/4 "2006-07-16T19:09:26Z")

</div>

> I’m sorry, Im reading about them in AWDWR and have started to read  
> through the API docs. What I wanted to know is the code part of the  
> helper files -\> app\helpers or part of the .rhtml pages ?  
> Oh - helpers are in app/helpers and are ruby methods. AWDWR should  
> cover all that in depth.

Steve

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 7:12pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/5 "2006-07-16T19:12:56Z")

</div>

:), so form\_helpers are part of the code that goes into the app\helpers  
files ?

Stuart

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 7:22pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/6 "2006-07-16T19:22:06Z")

</div>

> :), so form\_helpers are part of the code that goes into the app\helpers  
> files ?  
> I’m not sure what you mean by form\_helpers - are you talking about the  
> rails form helpers like ‘text\_field’ or ‘submit\_tag’?

View helpers are defined in app/helpers. So you can write methods that  
will be accessible in your views:

– app/helpers/pages\_helper.rb  
module PagesHelper  
def say(message)  
message  
end  
end

– app/views/pages/index.rhtml  
\<%= say ‘Hello!’ %\>

This would display:

Hello!

Hope that helps,

Steve

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/7 "2006-07-16T19:25:31Z")

</div>

These are the ones I’m speaking about . Yes the text\_field, etc.  
[http://api.rubyonrails.org/files/vendor/rails/actionpack/lib/action\_view/helpers/form\_helper\_rb.html](http://api.rubyonrails.org/files/vendor/rails/actionpack/lib/action_view/helpers/form_helper_rb.html)  
I gather they are not part of the code that goes into helper files.

Stuart

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [July 16, 2006, 7:34pm UTC](https://www.ruby-forum.com/t/form-helpers/98597/8 "2006-07-16T19:34:43Z")

</div>

> [http://api.rubyonrails.org/files/vendor/rails/actionpack/lib/action\_view/helpers/form\_helper\_rb.html](http://api.rubyonrails.org/files/vendor/rails/actionpack/lib/action_view/helpers/form_helper_rb.html)
> 
> I gather they are not part of the code that goes into helper files.  
> Sorry - i may still be a bit confused about what you mean :0)

The code for text\_field and the like are effectively the same as code  
you’d put into app/helpers when you write your own helper files. You  
can view that code yourself as i mentioned in my previous post.

Steve
