NoMethodError undefined method `link_to_function '
I added ActiveAdmin to my app, updated some gems and now I get undefined method `link_to_function'
when I view the page showing users. I have a gem will_paginate
and I added an initializer so there is no conflict.
kaminari.rb:
Kaminari.configure do |config|
config.page_method_name = :per_page_kaminari
end
The error points to a line from / app / helpers / will _paginate_helper.rb:
@template.link_to_function(text.to_s.html_safe, ajax_call, attributes)
+3
source to share
1 answer
Add a helper method and it will fix your problem.
link_to_function_helper.rb:
module LinkToFunctionHelper
def link_to_function(name, *args, &block)
html_options = args.extract_options!.symbolize_keys
function = block_given? ? update_page(&block) : args[0] || ''
onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function}; return false;"
href = html_options[:href] || '#'
content_tag(:a, name, html_options.merge(:href => href, :onclick => onclick))
end
end
+14
source to share