# Editable Data Grid?

**URL:** <https://www.ruby-forum.com/t/editable-data-grid/154771>\
**Category:** Rails\
**Created:** [December 3, 2008, 7:13pm UTC](https://www.ruby-forum.com/t/editable-data-grid/154771 "2008-12-03T19:13:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sa125](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@sa125](https://www.ruby-forum.com/u/sa125)\
**Post date:** [December 3, 2008, 7:13pm UTC](https://www.ruby-forum.com/t/editable-data-grid/154771/1 "2008-12-03T19:13:21Z")

</div>

Hello,

Being a new transfer to rails from [ASP.NET](http://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!

---

<div class="post-metadata">

**Author:** ![sa125](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@sa125](https://www.ruby-forum.com/u/sa125)\
**Post date:** [December 3, 2008, 8:12pm UTC](https://www.ruby-forum.com/t/editable-data-grid/154771/2 "2008-12-03T20:12:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sa125](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@sa125](https://www.ruby-forum.com/u/sa125)\
**Post date:** [December 4, 2008, 8:11am UTC](https://www.ruby-forum.com/t/editable-data-grid/154771/3 "2008-12-04T08:11:34Z")

</div>

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.
