# Form\_remote\_tag and form parameters problem in edge

**URL:** <https://www.ruby-forum.com/t/form-remote-tag-and-form-parameters-problem-in-edge/91087>\
**Category:** Rails\
**Created:** [April 4, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/form-remote-tag-and-form-parameters-problem-in-edge/91087 "2007-04-04T16:12:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarsoly\_AndrSSSSs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/57b2e6/32.png) [@Tarsoly\_AndrSSSSs](https://www.ruby-forum.com/u/Tarsoly_AndrSSSSs)\
**Post date:** [April 4, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/form-remote-tag-and-form-parameters-problem-in-edge/91087/1 "2007-04-04T16:12:15Z")

</div>

Hi guys,

anybody encountered such a problem that \<% form\_remote\_tag … %\>  
doesn’t send the data present in the form on submit?

Let me explain:

I have Products and the products have Properties.

# routes.rb

map.resources :products do |product|  
product.resources :properties  
end

I have a product edit form, which lists all the properties currently  
assigned to the product row by row, simple.

# \_properties.rb

\<% @product.properties.each do |property| %\>

  
  
\<% form\_remote\_tag( :url =\> property\_path( @product,  
property ), :method =\> :put ) do %\>  
  
  
\<%= submit\_tag “Save” %\>  
\<% end %\>  
  
  
\<% end %\>

The property controller takes care of updating:

# properties\_controller.rb

def update  
return false unless request.xhr?  
@property = ProductProperty.find( params[:id] )

# debug

logger.info “PARAMS: #{params.inspect}”

@property.update\_attributes( params[:property] )  
@product = Product.find( params[:product\_id] )  
end

All fine and dandy, there are 3 properties listed, I changed the  
values in the form and click save next to it. Log says:

# development.log

ProductProperty Columns (0.007000) SHOW FIELDS FROM  
product\_properties  
ProductProperty Load (0.002000) SELECT \* FROM product\_properties  
WHERE (product\_properties.`id` = 18)  
PARAMS: {“action”=\>“update”, “product\_id”=\>“1”, “id”=\>“18”,  
“controller”=\>“properties”}

NoMethodError (You have a nil object when you didn’t expect it!)  
…

Of course nil, because params[:property] is nil and i’m trying to  
udpate\_properties( ) on it. Log says, no additional parameters passed  
along with the request, but which were present in the form\_remote\_tag  
declaration.

Some additional info: same situation, plain \<% form\_tag … %\> works  
like a charm. Seems like a bug in \<% form\_remote\_tag … %\>.

Am I missing something? Tried everything at my disposal, still no  
luck. I’m on edge rails, latest revision.

Thanks and my best regards,  
András

---

<div class="post-metadata">

**Author:** ![Tarsoly\_AndrSSSSs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/57b2e6/32.png) [@Tarsoly\_AndrSSSSs](https://www.ruby-forum.com/u/Tarsoly_AndrSSSSs)\
**Post date:** [April 4, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/form-remote-tag-and-form-parameters-problem-in-edge/91087/2 "2007-04-04T16:56:22Z")

</div>

Hi Tarsoly,

Tarsoly András wrote:

> property.name %\>" /\>  
>   
> \<%= submit\_tag “Save” %\>  
> \<% end %\>
> 
> \<% end %\>

> Of course nil, because params[:property] is nil and i’m trying to  
> udpate\_properties( ) on it. Log says, no additional parameters passed  
> along with the request, but which were present in the form\_remote\_tag  
> declaration.

I think the problem you’re having is probably related to the fact that  
you’re hardcoding the form elements rather than letting Rails know about  
them. Try switching to text\_field or text\_field\_tag and see if that  
doesn’t  
help.

Best regards,  
Bill
