# Form\_for vs remote\_form\_for

**URL:** <https://www.ruby-forum.com/t/form-for-vs-remote-form-for/90828>\
**Category:** Rails\
**Created:** [April 2, 2007, 5:39am UTC](https://www.ruby-forum.com/t/form-for-vs-remote-form-for/90828 "2007-04-02T05:39:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [April 2, 2007, 5:39am UTC](https://www.ruby-forum.com/t/form-for-vs-remote-form-for/90828/1 "2007-04-02T05:39:59Z")

</div>

I currently have this form:

\<% form\_for :workout\_file, :url =\> { :action =\> ‘create’ }, :html =\>  
{ :multipart =\> true } do |f| -%\>

\<%= f.file\_field :uploaded\_data %\>

\<%= submit\_tag :Create %\>

\<% end -%\>

At the end of the action create I’ve got:

render :partial =\> ‘workouts’

I’d like the partial to render inside a specific div, so I change the  
form tag to:

\<% remote\_form\_for :workout\_file, :update =\> ‘contentArea’, :url =\>  
{ :action =\> ‘create’ }, :html =\> { :multipart =\> true } do |f| -%\>

But that creates the following error from attachments\_fu:

Thanx in advance!!

NoMethodError in WorkoutController#create

undefined method `content\_type’ for “/files/apps/polar/  
07031301.hrm”:String

RAILS\_ROOT: script/…/config/…  
Application Trace | Framework Trace | Full Trace

vendor/plugins/acts\_as\_attachment/lib/technoweenie/acts\_as\_attachment/  
instance\_methods.rb:56:in `uploaded_data=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/ base.rb:1660:in`attributes=’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active\_record/  
base.rb:1659:in `attributes=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/ base.rb:1493:in`initialize\_without\_callbacks’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active\_record/  
callbacks.rb:225:in `initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/ validations.rb:726:in`create!’  
app/controllers/workout\_controller.rb:94:in `create’
