Closed lcuevastodoit closed 3 years ago
Actually, I know what it is.
Please install the haml
gem :)
Cheers
You were right. I just needed to add gem 'haml-rails' Thanks,Now it does show me the table, but when I test the search bar in the datatable it shows me this error in browser
In the developer tools I see that the request was made via POST to https://my.domain/datatables/users_datatable-606275255219.json But I dont have a datatables controller
You shouldn't need any datatables controller. That's built in.
And that search should totally work. Is it giving you a console error you could post here? :)
This is the console error
Hmm, I was expecting a 403 error or something. I'm not sure why it would be 404.
The datatables search ajax request isn't even hitting your server?
In my rails server, I would expect to see something like
Maybe check out:
https://github.com/code-and-effect/effective_datatables_demo
Sorry this usually just works first time :)
It is hitting my server
It says "ApplicationController#route_not_found as JSON"
Hmm, yea perhaps you have some unique config that's preventing these requests.
Here is the routes file:
https://github.com/code-and-effect/effective_datatables/blob/master/config/routes.rb
and the controller it's calling:
There's, imho, nothing special going on in either of these that would not respond to json.
Is there something on your app raising a 404, or playing with the request formats? That ApplicationController.route_not_found
must be your app code, could it be raising a 404 somehow?
SOLVED: Dude you are an expert
As you said I had this route in the routes.rb, commenting it out eliminated the problem:
# match '*unmatched', to: 'application#route_not_found', via: :all
Thanks.
You're welcome! :D
Hello, excellent work, But still I need some help, because I am stuck just in the rendering of the first table of my User model. This is what it shows me
And a second problem is that I try to see what data the UsersDatatatable model sends from the console and all the variables are empty. So I can't do a troubleshooting
This is my datatable class
`class UsersDatatable < Effective::Datatable collection do User.all end
datatable do col :id col :email col :nombres end end`
Thanks in advance!