samedi 3 septembre 2016

link_to_remote equivalent in rails 4

I am upgrading from rails2.3.5 to rails4 and i am facing difficulty to convert link_to_remote into rails 4

link_to_remote("Retire", :url => { :action => :delete, :id => user.id },
               :condition => "confirm_retire(#{user.id})", :html => {:style => 'color: #CC0000;float:right;margin-right:8px;'})

I know that we need for this :remote => true with link_to like

link_to('Retire', {:action => :delete, :id => user.id},
               :condition => "confirm_retire(#{user.id})", :remote => true,
               :class => 'retire')

But i am facing problem with :condition => "confirm_retire(#{user.id})",

how to handle this ?, i did lot of research but not found any solution

Aucun commentaire:

Enregistrer un commentaire