% if @user.user_extensions.identity == UserExtensions::TEACHER %> <%= render :partial => 'my_course' %> <% else %> <%= render :partial => 'my_joinedcourse' %> <% end %>