Hi, I am trying to get form submitted data be submitted to my database, however not matter what I try it won''t work. in script/console Model.create(args) adds to the database just fine. pastie is here I''ve tried .create(!), .save after it, and Model.new in the action index. Thanks for any help --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Could you post your code so we can take a look at the actual actions? On Oct 7, 11:33 am, rpag <robert.glees...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am trying to get form submitted data be submitted to my database, > however not matter what I try it won''t work. in script/console > Model.create(args) adds to the database just fine. > > pastie is here > > I''ve tried .create(!), .save after it, and Model.new in the action > index. > Thanks for any help--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello, The correct syntax is Model.create!(@attributes) with the bang/exclamation point (!) after create, before the parentheses (not in them). See http://apidock.com/rails/ActiveRecord/Validations/ClassMethods/create! Regards Kieran On Wed, Oct 8, 2008 at 5:33 AM, rpag <robert.gleeson3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I am trying to get form submitted data be submitted to my database, > however not matter what I try it won''t work. in script/console > Model.create(args) adds to the database just fine. > > pastie is here > > I''ve tried .create(!), .save after it, and Model.new in the action > index. > Thanks for any help--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---