Forum: Ruby on Rails form_for vs remote_form_for

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9e7f68f8cf444a3a919a247e562bc464?d=identicon&s=25 Josh (Guest)
on 2007-04-02 05:39
(Received via mailing list)
I currently have this form:

<% form_for :workout_file, :url => { :action => 'create' }, :html =>
{ :multipart => true } do |f| -%>
  <p><%= f.file_field :uploaded_data %></p>
  <p><%= submit_tag :Create %></p>
<% 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/

RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace

instance_methods.rb:56:in `uploaded_data='
base.rb:1660:in `attributes='
base.rb:1659:in `attributes='
base.rb:1493:in `initialize_without_callbacks'
callbacks.rb:225:in `initialize'
validations.rb:726:in `create!'
app/controllers/workout_controller.rb:94:in `create'
This topic is locked and can not be replied to.