<%= user_course @state%> <% if @state == 0 %> <% if @user.user_extensions.identity == 0 %> <%= render :partial => 'my_course' %> <% else %> <%= render :partial => 'my_joinedcourse' %> <% end %> <% elsif @state == 1 %> <% if @user.user_extensions.identity == 0 %> <%= render :partial => 'my_create_homework' %> <% else %> <%= render :partial => 'my_homework' %> <% end %> <% else @state == 2 %> <%= render :partial => 'my_joinedcourse' %> <% end %>