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’