In my edit view I''ve got an upload image field. When the form is submitted it renders the update action with the put method. From what I understand the put method updates a resource. So what if there is no current image resource to update? Will the put actually look for a resource to update, and if it cannot find it will it create the resource? The reason I ask is because creating an image is optional in my new view and create method (the user can create is later when they edit the resource). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
>From what you''ve said it sounds like the image is not a resource butan attribute of some resource... I think you should be fine... try it! On Jul 2, 11:35 am, jko170 <jko...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> In my edit view I''ve got an upload image field. When the form is > submitted it renders the update action with the put method. From what > I understand the put method updates a resource. So what if there is no > current image resource to update? Will the put actually look for a > resource to update, and if it cannot find it will it create the > resource? > The reason I ask is because creating an image is optional in my new > view and create method (the user can create is later when they edit > the resource).--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m actually using attachment_fu with a Photo model. My ''new'' view has several models attached to the ''User'' within a form. Creating a photo on the create User action is optional. Basically I would like the user to be able to create a Photo object from the edit view / Update action. That''s why I''m wondering if the put method will create an object if none is found. If it doesn''t, then would I have to create a new method within the ''edit'' view that will ''POST'' a new photo? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---