Forum: Ruby on Rails Editable Data Grid?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7db3b1680807d393d40260591b4ae5e0?d=identicon&s=25 sa 125 (sa125)
on 2008-12-03 19:13
Hello,

Being a new transfer to rails from ASP.NET, I'm looking for some help on
how to approach an old problem with RoR. I build and maintain my
company's internal data site. We deal with finances, and thus I have
pages to display data grids of clients, products, accounts and all that.

These grids are edited on the spot, such that the user will click a data
row and enter "edit mode" on that row without having to go to a new page
(like it's done with scaffolds). These pages have all sorts of data
bound drop-down menus that enable filtering the data in the grid, which
I'd also like to recreate, as well as a free search text box. I'd also
like to spice it all up with some ajax.

So, to sum up, I want to create a page containing a data table (from the
bound model). Rendering the table is simple enough with <% for ... %>
tag, but I'd like to enable the user to click on a row and have it go
into edit mode (with save/cancel option). I'm also interested in how to
bind a drop-down to a table to allow filtering (say, a DDL showing a
list of suppliers for a grid of products). The ajax functionality comes
in on switching to and from edit mode (no page refresh), and when
filtering the grid (also no refresh).

And finally, since I'll be using this on several models, I'd like to be
able to generalize and re-use it without having to copy/paste too much
code (partials?).

I'd appreciate any pointers in the right direction, tips or relevant
links. Many thanks!
9f72aa5ee72bd13a8b443fbf3797944c?d=identicon&s=25 Kaushik katari (Guest)
on 2008-12-03 20:12
(Received via mailing list)
I have a simpler version of this problem. I think there are a couple of
ways
to approach this.

1> If you want the ability to make cell by cell modification in a table,
the
AJAXian in-place edit is the way to go.
2> I have a table where I want to have the ability to modify multiple
cells
at once. So I put the whole table in a form. It is updating the whole
page,
not AJAX.

Email me if you want to brain storm on this. I can share my code, and
see if
we can come up with a better approach.

Kaushik
7db3b1680807d393d40260591b4ae5e0?d=identicon&s=25 sa 125 (sa125)
on 2008-12-04 08:11
Thanks - I'll look into your suggestions, though it might take me a
while to come up with something. When I do, I'll repost to this thread.
This topic is locked and can not be replied to.