Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def index
- if params[:id]
- @user = User.find(params[:id], :include => [ :school ])
- if current_user.role?('advisor') && @user.school == current_user.school
- @entries = Entry.paginate :conditions => [ 'creator_id = ?', params[:id] ], :page => params[:page], :include => [ :tap, :creator ]
- respond_to do |format|
- format.html
- format.atom
- end
- else
- render_access_denied
- end
- else
- @user = current_user
- @entries = Entry.paginate :conditions => [ 'entries.creator_id = ?', current_user.id ], :page => params[:page], :include => [ :tap, :creator ]
- respond_to do |format|
- format.html
- format.atom
- end
- end
- end
Add Comment
Please, Sign In to add comment