[Rails] A "Rails" way to design a list-like page with CRUD capabilities?

Joe Van Dyk joevandyk at gmail.com
Fri Jan 21 23:17:46 GMT 2005


On Fri, 21 Jan 2005 15:06:47 -0800, Carl Youngblood <carlwork at ycs.biz> wrote:
> Duane Johnson wrote:
> 
> >The corresponding list.rhtml view will elegantly display the array of
> >Person objects.  But what if each "Person" row in the view is
> >editable?  For example, the view I am imagining would generate a text
> >box for the first name, last name and phone number, all the way down
> >the list, and a check box next to each person to delete the
> >corresponding person from the database.  Is there an elegant solution
> >to this pattern in Rails?  Any sample code from those of you who've
> >come across this and solved it before?
> >
> I think it would be even better to leave the list as plain text but add
> an edit link next to each person.  When clicked on, the edit link would
> change the HTML dynamically so that what previously appeared as plain
> text now appears as HTML inputs, and when the save button is clicked,
> the editing is saved in the database using XmlHttpRequest and the HTML
> inputs change back to plain text without having to refresh the page.
> This would be the way a next-generation Gmail-like web app would do things.
> 
> Carl
> _______________________________________________
I would love to see an implementation of that.


More information about the Rails mailing list