Guest User

Untitled

a guest
Jun 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. def index
  2. if params[:id]
  3. @user = User.find(params[:id], :include => [ :school ])
  4. if current_user.role?('advisor') && @user.school == current_user.school
  5. @entries = Entry.paginate :conditions => [ 'creator_id = ?', params[:id] ], :page => params[:page], :include => [ :tap, :creator ]
  6. respond_to do |format|
  7. format.html
  8. format.atom
  9. end
  10. else
  11. render_access_denied
  12. end
  13. else
  14. @user = current_user
  15. @entries = Entry.paginate :conditions => [ 'entries.creator_id = ?', current_user.id ], :page => params[:page], :include => [ :tap, :creator ]
  16. respond_to do |format|
  17. format.html
  18. format.atom
  19. end
  20. end
  21. end
Add Comment
Please, Sign In to add comment