lightbots
lightbots

Reputation: 485

Creating a dynamic table with movable rows

I would like to create a table of items like this invoice in Ruby on Rails, any hints on where I can start? I am fairly new to JavaScript. Also is there a gem that can do the job?

Upvotes: 2

Views: 127

Answers (2)

Ricardo Nacif
Ricardo Nacif

Reputation: 508

I would recommend using the Nested Form gem. http://railscasts.com/episodes/196-nested-model-form-part-1

Upvotes: 2

joni
joni

Reputation: 5472

I cant give a full example as your request is fairly generic. There are about 1000 possibilities to do this: use raw javascript, use jQuery, use jQuery Datatables, use Js + AngularJS etc. The only common thing is that a JSON backend on the server side is also needed, so your javascript can communicate with your server and save the data.

However, I would recommend the jQuery DataTables plugin. A starting point would be the "adding rows example". Also, check out the railscasts databable tutorial for details on JSON backend.

Upvotes: 2

Related Questions