gregbell/active_admin — Issue #802: No route matches {:controller=>"admin/sports", :action=>"switch"}
Author: sbuhr
Created: 2011-12-01 13:56:45+00:00
State: open

ActiveAdmin.register do

member_action :switch, :method => :post do
sport = Sport.find(params[:id])
sport.switch!
redirect_to :action => :index, :notice => "Status für #{sport.name} geändert!"
end

index do
column :name
column :competition_type
column "",:active do |sport|
div :class => sport.active.to_s do
link_to show_status(sport.active) , switch_admin_sport_path
end
end
default_actions
end

end

Gives me:

No route matches {:controller=>"admin/sports", :action=>"switch"}

I created a controller in Rails.root/app/controllers/admin/ with name sports_controller.rb and content

class Admin::SportsController < ApplicationController
def switch
puts "Working..."
end
end

But nothing happens. What am I doing wrong or missing here?

Thanks in advance