Guest User

Untitled

a guest
Jul 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. def user_id
  2.  
  3. if @current_user
  4. @current_user.id
  5. else
  6. nil
  7. end
  8. end
  9.  
  10.  
  11. def show
  12.  
  13. @article = Article.viewable(user_id).find(params[:id])
  14.  
  15. @blog = @article.blog
  16. @recentArticles = @blog.articles.published(:all, :limit=>5, :conditions=>"id!=#{@article.id}")
  17. @topics=@article.topics.find(:all, :limit=>5)
  18.  
  19. respond_to do |format|
  20. format.html # show.html.erb
  21. format.xml { render :xml => @article }
  22. end
  23. end
Add Comment
Please, Sign In to add comment