Guest User

Untitled

a guest
Dec 11th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class PostsController < ApplicationController
  2. layout :determine
  3.  
  4. def index
  5. end
  6.  
  7. def new
  8. end
  9.  
  10. def admin
  11.  
  12. render :index
  13. end
  14.  
  15. private
  16.  
  17. def determine
  18. return "special" if params[:special].to_i == 1
  19.  
  20. return case action_name
  21. when "new"
  22. "posts"
  23. when "admin"
  24. "admin/main"
  25. else
  26. "application"
  27. end
  28.  
  29. end
  30.  
  31. end
Add Comment
Please, Sign In to add comment