RailsCasts Pro episodes are now free!

Learn more or hide this

deman's Profile

GitHub User: deman

Comments by

Avatar

After some exploration, actually you can still use the url_helpers such as edit_product_path etc by just including the rails url_helper in your class e.g.

ruby
class YourDatatable
    include Rails.application.routes.url_helpers
.
.
def data
.
link_to("edit", edit_product_path(product)
end
end
Avatar

Hey anso,

Use the normal link_to :

ruby
link_to('Edit', :controller => 'products', :action => 'edit', :id => product)