does anyone have any ideas?

projects controller

 def create
    @project = Project.new(params[:project])
    @project.company_id = get_user.company.id
    @project.status_id = 2
    @project_file = Project_File.new(params[:uploaded_data])

    respond_to do |format|
      if @project.save
        flash[:notice] = 'Project was successfully created.'
        format.html { redirect_to(@project) }
        format.xml  { render :xml => @project, :status => :created, 
:location => @project }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @project.errors, :status => 
:unprocessable_entity }
      end
    end
  end

new project view
<% form_for(@project, :html => {:multipart => true}) do |f| %>
  <%= f.error_messages %>
   <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
  <p>
    <%= f.label :description %><br />
    <%= f.text_field :description %>
  </p>
  <p>
    <%= f.label :date_due %><br />
    <%= f.calendar_date_select :date_due %>
  </p>
    <p>
      <%= f.file_field :uploaded_data %>
    </p>
  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

<%= link_to 'Back', projects_path %>

project_file model

  belongs_to :project
  has_attachment :storage => :file_system, :path_prefix => 
'public/files', :partition => false
  validates_as_attachment


error message

 ActiveRecord::UnknownAttributeError in ProjectsController#create

unknown attribute: uploaded_data

RAILS_ROOT: /Users/louisbacon/Sites/codepress
Application Trace | Framework Trace | Full Trace

/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2587:in
 
`attributes='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2583:in
 
`each'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2583:in
 
`attributes='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2283:in
 
`initialize'
app/controllers/projects_controller.rb:61:in `new'
app/controllers/projects_controller.rb:61:in `create'

thanks a bunch



-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to