# Passing a hidden field to insert\_html

**URL:** <https://www.ruby-forum.com/t/passing-a-hidden-field-to-insert-html/135648>\
**Category:** Rails\
**Created:** [April 23, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/passing-a-hidden-field-to-insert-html/135648 "2008-04-23T21:41:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachocab](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a698b9/32.png) [@nachocab](https://www.ruby-forum.com/u/nachocab)\
**Post date:** [April 23, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/passing-a-hidden-field-to-insert-html/135648/1 "2008-04-23T21:41:50Z")

</div>

I’m trying to pass a hidden field (item\_property) to the add\_link  
helper function but when I do it the process threads start eating up  
memory and my computer freezes.

`
  def add_link(name)
    link_to_function name do |page|
      page.insert_html :bottom,:partial, :partial => 'item', :object
=> Item.new(:item_property => "Some text") #adding this parameter
creates a problem
    end
  end`

`
...
<%= f.hidden_field :item_property, :index => nil %>
<%= f.text_field :item_text, :index => nil %>`

`
<%= add_link "+Add Field Dinamically" %>`  
Does anybody know how to define a property of a new object in this  
context? I’ve been trying to figure it out for a month, so any help is  
very appreciated.  
Thanks

Nacho
