I have a devise model called admin which gives me current_admin and
the model has a method called role, which is either 'free' or
'standard' or 'premium'.
I have a dashboard_controller with three actions:
def index ... end
def free ... end
def premium ... end
I have a passthrough_controller that handles which dashboard action an
admin should be redirected to based on their role:
class PassthroughController < ApplicationController
path = case current_admin.role
And I have these routes set up:
devise_for :admins do
match "/admins/sign_out" => "devise/sessions#destroy"
match "/dashboard/index" => 'passthrough#index'
match "/dashboard/free" => 'dashboard#free', :as
match "/dashboard/standard" => 'dashboard#standard', :as
match "/dashboard/premium" => 'dashboard#premium', :as
This isn't working, but I'd like to know why it isn't working and
where I'm going wrong.