# Link\_to\_function error

**URL:** <https://www.ruby-forum.com/t/link-to-function-error/182491>\
**Category:** Rails\
**Created:** [January 28, 2010, 9:53pm UTC](https://www.ruby-forum.com/t/link-to-function-error/182491 "2010-01-28T21:53:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [January 28, 2010, 9:53pm UTC](https://www.ruby-forum.com/t/link-to-function-error/182491/1 "2010-01-28T21:53:04Z")

</div>

I have a link\_to\_function on one page to go to this edit screen with  
this link\_to\_function.

\<%= link\_to\_function ‘cancel’ do |page|  
page[:“work\_show\_#{work.id}”].hide  
end %\>

When I click on the edit button it says,  
missing ) after argument list  
[http://localhost:3000/](http://localhost:3000/)  
Line 2

If i take out  
page[:“work\_show\_#{work.id}”].hide

it works fine. Any ideas why it it saying there is an issue?

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [February 1, 2010, 2:10am UTC](https://www.ruby-forum.com/t/link-to-function-error/182491/2 "2010-02-01T02:10:55Z")

</div>

Anyone?

I can also do:

\<%= link\_to\_function “cancel” do |page|  
page.hide  
end %\>

When I click cancel it gives me an error which is expected as there is  
no element to hide. If I put any value say page[:foo].hide I get the  
same error as above.

missing ) after argument list [http://localhost:3000/](http://localhost:3000/) Line 2
