I want to add a row number for each row in my data table. I am using plugin from http://datatables.net The page which tells how to add the index is http://datatables.net/release-datatables/examples/api/counter_column.html
… however I don’t know how to actually implement it to make it work. I know extremely little about jquery / javascript which would help in this case. I don’t know where to put this code to make it work (if it helps i am also using Ruby on Rails)
The initialization code is:
jQuery ->
$('#staffs').dataTable
sPaginationType: "full_numbers"
bJQueryUI: true
}
Here is an example from datatables.net site DataTables row numbers example
Regarding your
SyntaxError: reserved word "function" on line 4 (in /home/ubuntu/ruby/scoreboard/app/assets/javascripts/staffs.js.coffee)'errortake a look at this rails, getting syntax error with coffee script