Ok, found this and here is the solution:
sidebar :actions do
button_to "Update projects", "/admin/projects/updateprojects", :method => :post, :confirm => "Are you sure?"
end
collection_action :updateprojects, :method => :post do
system "rake dataspider:import_projects_ninja"
redirect_to admin_projects_path, :notice => "Syncing..."
end
I created a button and runs the 'updateprojects' method
source
share