Forum: Ruby on Rails REST :put question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 jko170 (Guest)
on 2007-07-02 20:35
(Received via mailing list)
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
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).
Ab0b702e7fcc79bb7d2c6c67f64e1b4d?d=identicon&s=25 tmac (Guest)
on 2007-07-02 21:07
(Received via mailing list)
>From what you've said it sounds like the image is not a resource but
an attribute of some resource... I think you should be fine... try it!
1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 jko170 (Guest)
on 2007-07-02 21:21
(Received via mailing list)
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?
This topic is locked and can not be replied to.