Call from the controller
def index
begin
respond_to do |format|
format.html
Rails.logger.info(“sitesdatatable call”)
format.json { render json: WebDatatable.new(view_context) }
end
rescue Exception => e
logger.info(e)
end
It seems you have a similar setup to the one from the GitHub repository. To help you isolate the issue, I suggest taking the following steps:
Double-check that your Site model, controller, and corresponding views are set up correctly.
Verify that you have properly registered the new Site model in your routes.rb file.
Make sure you have the correct routes and route names in both the index.html.erb and site_datatable.rb. It might be helpful to compare these files with the User equivalents to spot any discrepancies.
Look into the JavaScript console for any errors, as they might indicate an issue with the DataTables setup.
Lastly, check your logs for any clues or errors. You can find them in the development.log file.
If the problem persists, feel free to provide more code snippets or error messages, and I’ll be glad to help you further.