server side processing with Rails
server side processing with Rails
Hi everyone , I am farily new to databales and wanted to check is there a way I can use databales for a rails application , please advise if there is a tutorial a link some documenation I could use just like how you have for the php
regards,
regards,
This discussion has been closed.
Replies
Regards,
Allan
The other option is just to load all of your rows (which sounds like is what is happening atm) and have DataTables use them on the client-side (just disabled the server-side processing flag). This will work well for smallish tables (upto 500 rows perhaps). After that server-side processing is probably better.
Allan
I did some homework at my end and found out that in rails we can do the pagination using paginate commands.
now the question is how do I integrate rails pagination with your plugin. I am pasting below the HTML that gets generated using the rails pagination.
I am thinking I just need to wrap the and somewhere in the jquery .. please advise
« Previous 1 2 3 4 5 6 7 8 9 … 64 65 Next »
It sounds like the code that you found is for pagination done in Rails with output to HTML. I don't think this is really what you want for DataTables integration. What you want to do is output the data in the JSON format that DataTables expects, as done in the link in my first post.
Regards,
Allan
First I want to congratulate Allan with the awesome jquery plugin you developed.
Secondly, I want to thank Chris Warren for the rails_datables plugin he published to simplify the live of a rails developer who want to use the benefits of both worlds.
I am currently switching from the normal datatable setup to the :ajax_source options, because my dataset becomes to large.
In the normal setup next to my object columns I also specified hyperlinks
[code]
<%= link_to 'Show', patient %>
<%= link_to 'Edit', edit_patient_path(patient) %>
<%= link_to 'Destroy', patient, :confirm => 'Are you sure ?', :method => :delete %>
[/code]
When I am now migrating to the :ajax_source option, the 'Show' and the 'Edit' link still work,
But the 'Destroy' link troubles me. The "link_to 'Destroy', patient, :confirm => 'Are you sure ?', :method => :delete" statement generates inline javascript:
[code]
'Wis'
[/code]
and the jquery datatables plugin doesn't like that.
Could you give me a hint how to handle this issue ?
I still want to ask the user for confirmation when, he decides to delete a patient.
Thanks in advance.