I’m working on adding in-place editing of one of my RESTful resources
and I need advice on how to make a change to the design patterns we
all know and love for the creation/editing of a new resource object.
Out of the box, Rails gives you the ‘new’ and ‘create’ actions for
creating a new resource object. This is fine for when you want a
separate page for initial creation and subsequent editing of that
But, now with in-place editing, my edits take place via the ‘show’
view with AJAX handling of those in place edts.
So, what’s the approach for when the user goes to create a new
I thought I could just redirect from the ‘new’ action to the ‘show’
action after creating the new obj, but with RESTful routing this takes
me to the index view.
Anybody know how to do this?
Or is it best practice to still have a full page edit form for the
initial edit and only go to in-place editing for subsequent edits?
A second issue involves validations… If I am able to do the in place
edit at creation, I have to create a new object for the ‘show’ action,
but there isnt any data actually entered prior to going there, so I
cant save the object because it wouldnt validate… so is there a way
to pass the unsaved object to the show action in this case?