jbox-web / ajax-datatables-rails

A wrapper around DataTable's ajax methods that allow synchronization with server-side pagination in a Rails app
MIT License
590 stars 227 forks source link

links to edit #263

Closed rsantelices closed 6 years ago

rsantelices commented 6 years ago

Hey guys im having a hard time getting the link_to to work properly, this is the code:

 def_delegator :@view, :link_to

def data
  records.map do |record|
    {
      id: link_to(record.id, edit_resource_path(record)),
      email:  record.email
    }
  end
end

However they do not render fine

ajahongir commented 6 years ago

https://github.com/jbox-web/ajax-datatables-rails/blob/master/README.md#using-view-helpers

ryleto commented 6 years ago

try adding the resource path attribute to the delegator line:

def_delegator :@view, :link_to, :edit_resource_path