Guest User

Untitled

a guest
Jul 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. def profile
  2. @can_edit = @user == current_user
  3. @title = "Gamer - " + @user.display_name
  4. @friends = @user.friends.all :order => "friends.created_at", :limit => 8
  5. @games = @user.games.active.all :limit => 8
  6. @platforms = @user.platforms.all :limit => 8
  7. @articles ||= @user.published_articles.paginate(:per_page => 10, :page => params[:articles_page])
  8. @article_count ||= @articles.total_entries
  9. @comments = @user.comments.paginate :order => "created_at DESC", :page => 1, :per_page => 20
  10. render :action => "profile"
  11. end
  12.  
  13. def page_articles
  14. @articles = @user.published_articles.paginate(:per_page => 10, :page => params[:page])
  15. @article_count = @articles.total_entries
  16.  
  17. if request.xhr?
  18. render :partial => "gamer/articles_page", :locals => {:articles => @articles, :articles_url => gamer_profile_articles_nopage_url(:gamer => @user.token)}
  19. else
  20. profile
  21. end
  22. end
Add Comment
Please, Sign In to add comment