This is my custom page in Active Admin
ActiveAdmin.register_page "Settings" do
action_item do
link_to('Import projects', 'settings/importprojects')
end
content do
para "Text"
end
controller do
def importprojects
system "rake dataspider:import_projects_ninja"
para "OK"
end
end
end
What I’m trying to do is, when I click on the button ‘import projects’, I want to preform a rake task with is in the controller. But I can’t access the method.
What could be the problem or what I’m a doing wrong?
Thanks
Okay, found it and here is the solution:
I created an button and it runs the method ‘updateprojects’