Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.03 KB | None | 0 0
  1.   def user_role_pages
  2.    if current_user.role == 4
  3.      @user_institutions=User.find(current_user.id)
  4.      @institution= @user_institutions.institutions
  5.    else
  6.      @institution=Institution.all
  7.    end
  8.       if params[:role] == "2"
  9.        render :partial=> "docentes", :locals=> {:institution=>@institution}
  10.       else
  11.         if params[:role] == "1"
  12.            render :partial=> "user", :locals=> {:institution=>@institution}
  13.        else    
  14.           if params[:role] == "4"
  15.               render :partial=> "admin", :locals=> {:institution=>@institution}
  16.           else
  17.               if params[:role]=="5"
  18.                 render :partial=> "superadmin"
  19.               else
  20.                 if params[:role] == "3"
  21.                   render :partial=> "supervisor_user"
  22.                 else
  23.                   if params[:role] == "6"
  24.                      render :partial=> "docenteadmin", :locals=> {:institution=>@institution}
  25.                   end
  26.                 end
  27.  
  28.               end
  29.           end
  30.         end
  31.       end
  32.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement