No..i am not a full time rails developer...i code in pl/sql for paying my bills...and i am just working on a pet project...so i had some trouble in doing..what i specify in the subject.....now somehow i solved this problem...so those interested can look at the code at: http://hemant.wordpress.com/2006/04/25/file_column-and-how-the-fuck-it-handles-multiple-files/ I write this mail and [blog]post....so that Amy doesn''t call me a Help monster. :) -- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/74d0b108/attachment.html
Steve Koppelman
2006-Apr-25 13:10 UTC
[Rails] Re: [TIPS] File_column plugin and multiple file uploads
I read your blog post. You seem to be complicating things. It is perfectly valid to have multiple fields in the same table use file_column. Why not just say in your model file_column :picture_1 file_column :picture_2 ... and then simply let file_column work like it''s supposed to, complete with file_column_field helpers? hemant kumar wrote:> No..i am not a full time rails developer...i code in pl/sql for paying > my > bills...and i am just working on a pet project...so i had some trouble > in > doing..what i specify in the subject.....now somehow i solved this > problem...so those interested can look at the code at: > > http://hemant.wordpress.com/2006/04/25/file_column-and-how-the-fuck-it-handles-multiple-files/ > > I write this mail and [blog]post....so that Amy doesn''t call me a Help > monster. :)-- Posted via http://www.ruby-forum.com/.
hemant
2006-Apr-25 13:18 UTC
[Rails] Re: [TIPS] File_column plugin and multiple file uploads
But then i thought in "file_column :picture", picture must be a column in the table, right? and i have only one column to store filenames in my table....correct me, if i am wrong? On 4/25/06, Steve Koppelman <hatlessnyc@yahoo.com> wrote:> > I read your blog post. You seem to be complicating things. It is > perfectly valid to have multiple fields in the same table use > file_column. > > Why not just say in your model > > file_column :picture_1 > file_column :picture_2 > ... > > and then simply let file_column work like it''s supposed to, complete > with file_column_field helpers? > > > hemant kumar wrote: > > No..i am not a full time rails developer...i code in pl/sql for paying > > my > > bills...and i am just working on a pet project...so i had some trouble > > in > > doing..what i specify in the subject.....now somehow i solved this > > problem...so those interested can look at the code at: > > > > > http://hemant.wordpress.com/2006/04/25/file_column-and-how-the-fuck-it-handles-multiple-files/ > > > > I write this mail and [blog]post....so that Amy doesn''t call me a Help > > monster. :) > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/e8a2c62c/attachment-0001.html
hemant
2006-Apr-25 13:24 UTC
[Rails] Re: [TIPS] File_column plugin and multiple file uploads
Also is it a good idea to predefine, the number of files that i can upload?....though my current code relies on that..but i am gonna change that...and if in the model class itself i specify how many columns i need then i am stuck there, right? On 4/25/06, hemant <gethemant@gmail.com> wrote:> > But then i thought in "file_column :picture", picture must be a column in > the table, right? > and i have only one column to store filenames in my table....correct me, > if i am wrong? > > > > On 4/25/06, Steve Koppelman <hatlessnyc@yahoo.com> wrote: > > > > I read your blog post. You seem to be complicating things. It is > > perfectly valid to have multiple fields in the same table use > > file_column. > > > > Why not just say in your model > > > > file_column :picture_1 > > file_column :picture_2 > > ... > > > > and then simply let file_column work like it''s supposed to, complete > > with file_column_field helpers? > > > > > > hemant kumar wrote: > > > No..i am not a full time rails developer...i code in pl/sql for paying > > > > > my > > > bills...and i am just working on a pet project...so i had some > > trouble > > > in > > > doing..what i specify in the subject.....now somehow i solved this > > > problem...so those interested can look at the code at: > > > > > > > > http://hemant.wordpress.com/2006/04/25/file_column-and-how-the-fuck-it-handles-multiple-files/ > > > > > > I write this mail and [blog]post....so that Amy doesn''t call me a Help > > > monster. :) > > > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > nothing much to talk >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/8331de3b/attachment.html
Matt White
2006-Apr-25 13:53 UTC
[Rails] Re: [TIPS] File_column plugin and multiple file uploads
If I have a model that requires a variable # of images, I usually just create an additional table called model_images, and then add a :has_many => :model_images (with a corresponding belongs_to :model in the images model) to my model. That way if you need to have metadata about the images (captions, or whatever), you can store that in the images table. This way your # of images is unlimited, and you can just add a :file_column :image or whatever to your images table. Works for me... Matt On 4/25/06, hemant <gethemant@gmail.com> wrote:> > Also is it a good idea to predefine, the number of files that i can > upload?....though my current code relies on that..but i am gonna change > that...and if in the model class itself i specify how many columns i need > then i am stuck there, right? > > > On 4/25/06, hemant <gethemant@gmail.com> wrote: > > > > But then i thought in "file_column :picture", picture must be a column > > in the table, right? > > and i have only one column to store filenames in my table....correct me, > > if i am wrong? > > > > > > > > On 4/25/06, Steve Koppelman <hatlessnyc@yahoo.com> wrote: > > > > > > I read your blog post. You seem to be complicating things. It is > > > perfectly valid to have multiple fields in the same table use > > > file_column. > > > > > > Why not just say in your model > > > > > > file_column :picture_1 > > > file_column :picture_2 > > > ... > > > > > > and then simply let file_column work like it''s supposed to, complete > > > with file_column_field helpers? > > > > > > > > > hemant kumar wrote: > > > > No..i am not a full time rails developer...i code in pl/sql for > > > paying > > > > my > > > > bills...and i am just working on a pet project...so i had some > > > trouble > > > > in > > > > doing..what i specify in the subject.....now somehow i solved this > > > > problem...so those interested can look at the code at: > > > > > > > > http://hemant.wordpress.com/2006/04/25/file_column-and-how-the-fuck-it-handles-multiple-files/ > > > > > > > > > > > I write this mail and [blog]post....so that Amy doesn''t call me a > > > Help > > > > monster. :) > > > > > > > > > -- > > > Posted via http://www.ruby-forum.com/. > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > -- > > nothing much to talk > > > > > > -- > nothing much to talk > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/90afaf00/attachment-0001.html
Matt White
2006-Apr-25 13:57 UTC
[Rails] Re: [TIPS] File_column plugin and multiple file uploads
Whoops... Too early... I meant ":file_column :image to your images model" On 4/25/06, Matt White <stockliasteroid@gmail.com> wrote:> > If I have a model that requires a variable # of images, I usually just > create an additional table called model_images, and then add a :has_many => > :model_images (with a corresponding belongs_to :model in the images model) > to my model. That way if you need to have metadata about the images > (captions, or whatever), you can store that in the images table. This way > your # of images is unlimited, and you can just add a :file_column :image or > whatever to your images table. > > Works for me... > > Matt > > On 4/25/06, hemant <gethemant@gmail.com> wrote: > > > Also is it a good idea to predefine, the number of files that i can > upload?....though my current code relies on that..but i am gonna change > that...and if in the model class itself i specify how many columns i need > then i am stuck there, right? > > > On 4/25/06, hemant < gethemant@gmail.com> wrote: > > > > But then i thought in "file_column :picture", picture must be a column > > in the table, right? > > and i have only one column to store filenames in my table....correct me, > > if i am wrong? > > > > > > > > On 4/25/06, Steve Koppelman <hatlessnyc@yahoo.com> wrote: > > > > > > I read your blog post. You seem to be complicating things. It is > > > perfectly valid to have multiple fields in the same table use > > > file_column. > > > > > > Why not just say in your model > > > > > > file_column :picture_1 > > > file_column :picture_2 > > > ... > > > > > > and then simply let file_column work like it''s supposed to, complete > > > with file_column_field helpers? > > > > > > > > > hemant kumar wrote: > > > > No..i am not a full time rails developer...i code in pl/sql for > > > paying > > > > my > > > > bills...and i am just working on a pet project...so i had some > > > trouble > > > > in > > > > doing..what i specify in the subject.....now somehow i solved this > > > > problem...so those interested can look at the code at: > > > > > > > > http://hemant.wordpress.com/2006/04/25/file_column-and-how-the-fuck-it-handles-multiple-files/ > > > > > > > > > > > I write this mail and [blog]post....so that Amy doesn''t call me a > > > Help > > > > monster. :) > > > > > > > > > -- > > > Posted via http://www.ruby-forum.com/. > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > -- > > nothing much to talk > > > > > > -- > nothing much to talk > > _______________________________________________ > > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/fa511600/attachment.html
hemant
2006-Apr-25 14:06 UTC
[Rails] Re: [TIPS] File_column plugin and multiple file uploads
yeah...got it....thatz a cool idea....but right now basically pictures table is like your model_images table......and i am storing all the metadata, like Tags and all that in this table itself.... On 4/25/06, Matt White <stockliasteroid@gmail.com> wrote:> > Whoops... Too early... I meant ":file_column :image to your images model" > > > On 4/25/06, Matt White < stockliasteroid@gmail.com> wrote: > > > > If I have a model that requires a variable # of images, I usually just > > create an additional table called model_images, and then add a :has_many => > > :model_images (with a corresponding belongs_to :model in the images model) > > to my model. That way if you need to have metadata about the images > > (captions, or whatever), you can store that in the images table. This way > > your # of images is unlimited, and you can just add a :file_column :image or > > whatever to your images table. > > > > Works for me... > > > > Matt > > > > On 4/25/06, hemant <gethemant@gmail.com> wrote: > > > > > Also is it a good idea to predefine, the number of files that i can > > upload?....though my current code relies on that..but i am gonna change > > that...and if in the model class itself i specify how many columns i need > > then i am stuck there, right? > > > > > > On 4/25/06, hemant < gethemant@gmail.com> wrote: > > > > > > But then i thought in "file_column :picture", picture must be a column > > > in the table, right? > > > and i have only one column to store filenames in my table....correct > > > me, if i am wrong? > > > > > > > > > > > > On 4/25/06, Steve Koppelman <hatlessnyc@yahoo.com> wrote: > > > > > > > > I read your blog post. You seem to be complicating things. It is > > > > perfectly valid to have multiple fields in the same table use > > > > file_column. > > > > > > > > Why not just say in your model > > > > > > > > file_column :picture_1 > > > > file_column :picture_2 > > > > ... > > > > > > > > and then simply let file_column work like it''s supposed to, complete > > > > with file_column_field helpers? > > > > > > > > > > > > hemant kumar wrote: > > > > > No..i am not a full time rails developer...i code in pl/sql for > > > > paying > > > > > my > > > > > bills...and i am just working on a pet project...so i had some > > > > trouble > > > > > in > > > > > doing..what i specify in the subject.....now somehow i solved this > > > > > problem...so those interested can look at the code at: > > > > > > > > > > http://hemant.wordpress.com/2006/04/25/file_column-and-how-the-fuck-it-handles-multiple-files/ > > > > > > > > > > > > > > I write this mail and [blog]post....so that Amy doesn''t call me a > > > > Help > > > > > monster. :) > > > > > > > > > > > > -- > > > > Posted via http://www.ruby-forum.com/. > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > -- > > > nothing much to talk > > > > > > > > > > > -- > > nothing much to talk > > > > _______________________________________________ > > > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/512f3132/attachment-0001.html
Steve Koppelman
2006-Apr-25 14:25 UTC
[Rails] Re: Re: [TIPS] File_column plugin and multiple file uploads
Yes, you would need a varchar/:string column in your table for each file_column. Sorry, your action name and the post titles confused me. This looks like a method just for adding multiple new image records from a single form. I gather that mutliple instances of <%= file_column_field "picture[], "filename" -%> in a single form doesn''t work, eh? hemant kumar wrote:> But then i thought in "file_column :picture", picture must be a column > in > the table, right? > and i have only one column to store filenames in my table....correct me, > if > i am wrong?-- Posted via http://www.ruby-forum.com/.