Guest User

Untitled

a guest
Jan 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <%=render 'layouts/footer' %>
  2.  
  3. <%= render partial: 'activitiy_items/recent' %>
  4.  
  5. render partial: 'some/path/to/my/partial', locals: { custom_var: 'Hello' }
  6.  
  7. <html>
  8. <head>
  9. <%= yield :html_head %>
  10. </head>
  11. <body>
  12. <div id="sidebar">
  13. <%= yield :sidebar %>
  14. </div>
  15. </body>
  16.  
  17. <% content_for :sidebar do %>
  18. This content will show up in the sidebar section
  19. <% end %>
  20.  
  21. <% content_for :html_head do %>
  22. <script type="text/javascript">
  23. console.log("Hello World!");
  24. </script>
  25. <% end %>
  26.  
  27. <html>
  28. <head>
  29. <script type="text/javascript">
  30. console.log("Hello World!");
  31. </script>
  32. </head>
  33. <body>
  34. <div id="sidebar">
  35. This content will show up in the sidebar section
  36. </div>
  37. </body>
  38.  
  39. def index
  40. @books = Book.all
  41. end
  42.  
  43. def show
  44. @book = Book.find_by(id: params[:id])
  45. if @book.nil?
  46. render action: "index"
  47. end
  48. end
  49.  
  50. def index
  51. @books = Book.all
  52. end
  53.  
  54. def show
  55. @book = Book.find_by(id: params[:id])
  56. if @book.nil?
  57. redirect_to action: :index
  58. end
  59. end
  60.  
  61. def index
  62. @books = Book.all
  63. end
  64.  
  65. def show
  66. @book = Book.find_by(id: params[:id])
  67. if @book.nil?
  68. @books = Book.all
  69. flash.now[:alert] = "Your book was not found"
  70. render "index"
  71. end
  72. end
Add Comment
Please, Sign In to add comment