I’m relatively new! I based my controller structure on the learn project.
My app has different user types/model. Radiologist and MedicalInstitution (not sure if those are good names btw). They have polymorphic association to User.
I would like each of the
The controllers so far:
HomesController - Verify if user is logged in or not. If yes redirect to dashboard_path if not redirect to landing page.
Dashboard Controller - “Display the current user profile.” Code:
class DashboardsController < ApplicationController before_filter :authenticate_user! def show @user = current_user.profile render # ????:(based on @user.role or something) end end
Is this a good idea, or would you split the controllers? I feel that RadiologistController’s show action would be for other people to view radiologist profiles, not for the Radiologist himself to view his profile/private things.