# Custom Helper Using Block

**URL:** <https://www.ruby-forum.com/t/custom-helper-using-block/168019>\
**Category:** Rails\
**Created:** [May 15, 2009, 12:45am UTC](https://www.ruby-forum.com/t/custom-helper-using-block/168019 "2009-05-15T00:45:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kopf1988](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/74df32/32.png) [@kopf1988](https://www.ruby-forum.com/u/kopf1988)\
**Post date:** [May 15, 2009, 12:45am UTC](https://www.ruby-forum.com/t/custom-helper-using-block/168019/1 "2009-05-15T00:45:22Z")

</div>

Hi 🙂

What should I do to try to create a contact form that works like this:

\<%= contact\_form do |f| %\>  
Employer: \<%= f.text\_field :employer %\>  
  
\<% end %\>

The problem so far is that I seem to have a tough time calling things  
like f.remote\_form\_for(@contact) in a helper - it just doesn’t  
cooperate.

Or you could try to help me in another way? I tried putting a block/  
proc in the view to do this, but when I use bloc.call(f) the fields  
show up twice - once where I had originally defined them, and once  
where I used the call function. Any ideas?? What I tried was like

\<% bloc = Proc.new() do |f| %\>  
Employer: \<%= f.text\_field :employer %\>  
  
\<% end %\>  
then I created the form like normal and called bloc.call(f), but it  
showed up in two places. Suggestions? Thanks for any help on either of  
these… I really want to make this form more ruby-esque.

-Kopf1988
