ajahongir / ajax-datatables-rails-v-0-4-0-how-to

ajax-datatables-rails v-0-4-0 sample project code
12 stars 6 forks source link

app/datatables/city_datatable.rb is outdated #5

Open jonas-zipprick opened 7 years ago

jonas-zipprick commented 7 years ago

the parameter passed to the condition is now the prcessed search term and not the entire column object. The file app/datatables/city_datatable.rb still works on the column object.

cfgv commented 7 years ago

I would like to know if it is already solving?

ajahongir commented 7 years ago

the changes was reverted back. and now looks like https://github.com/jbox-web/ajax-datatables-rails/blob/master/lib/ajax-datatables-rails/datatable/column.rb#L46

so now 2 params: column, search_value

cfgv commented 7 years ago

ok, how can I call the custom filter? I need to searching by nested models: payment.reservation.customer.name

ajahongir commented 7 years ago

you can use Arel syntax like here https://github.com/ajahongir/ajax-datatables-rails-v-0-4-0-how-to/blob/master/app/datatables/city_datatable.rb#L35

cfgv commented 7 years ago

I can't understand that, I'm creating a Proc, but in the method I'm just receiving the search parameter, but not the column object,

Look at this:

screen shot 2017-09-13 at 2 42 31 pm screen shot 2017-09-13 at 2 42 41 pm screen shot 2017-09-13 at 2 44 09 pm
ajahongir commented 7 years ago

I am not sure what version are you using now. BUT you can see at master branch - https://github.com/jbox-web/ajax-datatables-rails/blob/master/lib/ajax-datatables-rails/datatable/column.rb#L46 than proc is recieving column object and formated_value param. so make sure than you are using a right version.

couple commits ago someone removed column object but after we reverted it back.

ajahongir commented 7 years ago

https://github.com/jbox-web/ajax-datatables-rails/commit/07795fd26849ff1b3b567f4ce967f722907a45be#diff-a7f0f3ee893084549cc5255576b14fe3

ajahongir commented 7 years ago

I recoment to use master branch but it could be not stable.

ajahongir commented 7 years ago

so now have 2 params - https://github.com/jbox-web/ajax-datatables-rails/commit/12f9709e00552a766bc9f00d717c66c96cd229f2#diff-a7f0f3ee893084549cc5255576b14fe3R46

cfgv commented 7 years ago

I was watching the ruby gem and is linked from https://github.com/ajahongir/ajax-datatables-rails and I seen that repository is https://github.com/jbox-web/ajax-datatables-rails, Alright?

cfgv commented 7 years ago

I can't understand that, into my Gemfile use gem 'ajax-datatables-rails', github: 'ajahongir/ajax-datatables-rails', branch: 'v-0-4-0' and It worked...

ajahongir commented 7 years ago

https://github.com/jbox-web/ajax-datatables-rails you should use this one

cfgv commented 7 years ago

Ok, Thanks