Displaying form data, then editing it in place.

19 views
Skip to first unread message

j...@via.net

unread,
May 24, 2015, 2:48:14 PM5/24/15
to rubyonra...@googlegroups.com
I wrote some pretty ugly code that allows me to pull data from a database and view it. If I wanted to edit/update any of the data,
I push the 'edit' button at the bottom of the page and the page updates with all text fields replaced with editable form fields.

I always felt like I was reinventing the wheel. Surely, someone else has written a gem to do this?

Any ideas?

Thanks,

Joe

Colin Law

unread,
May 24, 2015, 3:29:16 PM5/24/15
to rubyonra...@googlegroups.com
On 24 May 2015 at 19:48, j...@via.net <j...@via.net> wrote:
> I wrote some pretty ugly code that allows me to pull data from a database
> and view it. If I wanted to edit/update any of the data,
> I push the 'edit' button at the bottom of the page and the page updates with
> all text fields replaced with editable form fields.

What is ugly about the code you have written? Is what you describe
not the normal view page and edit page?

Colin

James Davis, PhD

unread,
May 25, 2015, 9:24:13 AM5/25/15
to rubyonra...@googlegroups.com
Take a look at the best_in_place gem. It works similiar to what you describe.

Ivan Lasorsa

unread,
May 25, 2015, 10:42:23 AM5/25/15
to rubyonra...@googlegroups.com
X-editable is pretty good for this
http://vitalets.github.io/x-editable/

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages