views:

570

answers:

1

I have used the "tutorial" on here but for some reason it didn't work.

Can anyone give me a step-by-step guide for setting up a multiple image form (upload) with other form elements ...

Also another tutorial (a good one) may be provided.

I only want to use the paperclip plugin.

@Gordon Isnor: I have uploaded my current (noob) project with some functionality (login, register) but it's not even fine tuned a little. I'm only trying to get the multiple images working, all code of the "multiple" images is deleted in this source. So it's clean and running. (don't notice the current login for now ;-)) Ps. Using the default's nifty_scaffold and etc... :)

For stackoverflow's eyes only: Rapidshare link (- 100 kb.

+4  A: 

Do you have examples of code? It would be easier to help if there was something to look at, or a more detailed description of how it’s not working.

Ok --

Some points to help you get started:

1 - in your Progress model you are accepting nested attributes for a model that does not exist: you need a ProgressImage model with a Paperclip attachment:

class ProgressImage < ActiveRecord::Base
  belongs_to :progress
  has_attached_file :photo
end

2 - Your progress form is not multipart, it will needs to be:

<% form_for @progress, :html => { :multipart => true } do |f| %>

3 - Your progress form needs nested attribute file fields, there are various articles about how to do this:

http://weblog.rubyonrails.org/2009/1/26/nested-model-forms

4- There’s also a plugin that I have found useful for nested attribute forms, called add_nested_fields: http://github.com/miletbaker/add_nested_fields

5 - You have a migration to add paperclip columns to the non-existent progress images table - you might as well change that migration to create the table, and include those paperclip-specific columns and then you need to run it using rake db:migrate.

Gordon Isnor
I have added my project source @ http://rapidshare.com/files/354019110/FitJournal.rar for StackOverflow's eyes only :-)
NicoJuicy
Thanks. Seems to be good advice!
NicoJuicy