# Calling form\_remote\_tag in a helper

**URL:** <https://www.ruby-forum.com/t/calling-form-remote-tag-in-a-helper/150686>\
**Category:** Rails\
**Created:** [October 11, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/calling-form-remote-tag-in-a-helper/150686 "2008-10-11T14:48:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garrett\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4da419/32.png) [@Garrett\_B](https://www.ruby-forum.com/u/Garrett_B)\
**Post date:** [October 11, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/calling-form-remote-tag-in-a-helper/150686/1 "2008-10-11T14:48:09Z")

</div>

Apparently inside a helper form\_remote\_tag cannot take a block because  
\_erbout is out of scope. As of a year ago the accepted way to handle  
this was to call form\_remote\_tag without a block, like this;

form\_remote\_tag(:url =\> { :controller =\> stuf } ) +  
submit\_tag(button\_text) +  
end\_form\_tag

Now end\_form\_tag is deprecated, and we are supposed to use blocks  
instead. Actually, the method no longer exists, so I guess it is not  
even deprecated anymore. Regardless, can I just replace end\_form\_tag  
with “” or does the method do more then that?

---

<div class="post-metadata">

**Author:** ![Garrett\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4da419/32.png) [@Garrett\_B](https://www.ruby-forum.com/u/Garrett_B)\
**Post date:** [October 11, 2008, 4:05pm UTC](https://www.ruby-forum.com/t/calling-form-remote-tag-in-a-helper/150686/2 "2008-10-11T16:05:26Z")

</div>

It would be like this:

\<% form\_remote\_tag :url =\> {:controller =\> stuf} do %\>  
\<%= submit\_tag(button\_text) %\>  
\<% end %\>

On Sat, Oct 11, 2008 at 9:47 AM, Garrett B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Now end\_form\_tag is deprecated, and we are supposed to use blocks  
> instead. Actually, the method no longer exists, so I guess it is not  
> even deprecated anymore. Regardless, can I just replace end\_form\_tag  
> with “” or does the method do more then that?

–  
Maurício Linhares  
[http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) | [http://blog.codevader.com/](http://blog.codevader.com/)  
(en)  
João Pessoa, PB, +55 83 8867-7208

---

<div class="post-metadata">

**Author:** ![Garrett\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4da419/32.png) [@Garrett\_B](https://www.ruby-forum.com/u/Garrett_B)\
**Post date:** [October 12, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/calling-form-remote-tag-in-a-helper/150686/3 "2008-10-12T18:31:37Z")

</div>

That doesn’t work. When you are in a helper instead of a view  
form\_remote\_tag cannot except a block because \_erbout is out of scope.

On Oct 11, 10:04 am, “Maurício Linhares” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Garrett\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4da419/32.png) [@Garrett\_B](https://www.ruby-forum.com/u/Garrett_B)\
**Post date:** [October 12, 2008, 7:23pm UTC](https://www.ruby-forum.com/t/calling-form-remote-tag-in-a-helper/150686/4 "2008-10-12T19:23:16Z")

</div>

On 11 Oct 2008, at 13:47, Garrett B. wrote:

> Now end\_form\_tag is deprecated, and we are supposed to use blocks  
> instead. Actually, the method no longer exists, so I guess it is not  
> even deprecated anymore. Regardless, can I just replace end\_form\_tag  
> with “” or does the method do more then that?

end\_form\_tag just generated ‘’

IIRC on edge (soon to be 2.2) all that \_erbout stuff was removed, so  
you might find that these problems mostly go away.

Fred
