Hi, again. about Attachment_fu, I wanted to add MANY pictures (portfolios-table) to a current_user. well, I can only add ONE picture. Adding one more results in this error: Mysql::Error: #42S22Unknown column ''id'' in ''where clause'': UPDATE portfolios SET `thumbnail` = ''thumb'', `content_type` = ''image/jpeg'', `user_id` = NULL, `height` = 81, `filename` = ''godjesus_thumb.jpg'', `width` = 100, `parent_id` = 0, `size` = ''77847'' WHERE `id` = NULL Now, why does it do this to me? It''s as if it doesn''t create a new direcotry called ''0001'' and instead uses ''0000'' where the picture is placed. If I delete the complete directory and delete the rows from my table I can add a new picture and it creates the ''0000'' directory. Any suggestions, etc for solving this problem? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 06 Feb 2008, at 16:52, Dag Stensson wrote:> about Attachment_fu, I wanted to add MANY pictures (portfolios- > table) to > a current_user. > well, I can only add ONE picture. Adding one more results in this > error: > > Mysql::Error: #42S22Unknown column ''id'' in ''where clause'': UPDATE > portfolios SET `thumbnail` = ''thumb'', `content_type` = ''image/jpeg'', > `user_id` = NULL, `height` = 81, `filename` = ''godjesus_thumb.jpg'', > `width` = 100, `parent_id` = 0, `size` = ''77847'' WHERE `id` = NULL > > Now, why does it do this to me? It''s as if it doesn''t create a new > direcotry called ''0001'' and instead uses ''0000'' where the picture is > placed. If I delete the complete directory and delete the rows from my > table I can add a new picture and it creates the ''0000'' directory. Any > suggestions, etc for solving this problem?Looks like you''ve set :id => false in your portfolios table migration, while it should be there. I''m using one-to-many relationships with an attachment_fu model in a lot of our apps without a single problem. Something is wrong with your database structure. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt wrote:> On 06 Feb 2008, at 16:52, Dag Stensson wrote: > >> >> Now, why does it do this to me? It''s as if it doesn''t create a new >> direcotry called ''0001'' and instead uses ''0000'' where the picture is >> placed. If I delete the complete directory and delete the rows from my >> table I can add a new picture and it creates the ''0000'' directory. Any >> suggestions, etc for solving this problem? > > Looks like you''ve set :id => false in your portfolios table > migration, while it should be there. > > I''m using one-to-many relationships with an attachment_fu model in a > lot of our apps without a single problem. Something is wrong with > your database structure. > > Best regards > > Peter De BerdtHi, I guess I''ll have to do a re-do of it then. My problem started because I couldn''t migrate my database-table so I did it manually, and somehow I must have done something wrong there. The :id you''re talking about is not the parent_id I''m guessing? Using SQL-fron there allways was a pre-defined :id, but in SQLyog there is none visable. I''ll try it again, and hopefully re-doing it will solve it. Thanks -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---