Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%=render 'layouts/footer' %>
- <%= render partial: 'activitiy_items/recent' %>
- render partial: 'some/path/to/my/partial', locals: { custom_var: 'Hello' }
- <html>
- <head>
- <%= yield :html_head %>
- </head>
- <body>
- <div id="sidebar">
- <%= yield :sidebar %>
- </div>
- </body>
- <% content_for :sidebar do %>
- This content will show up in the sidebar section
- <% end %>
- <% content_for :html_head do %>
- <script type="text/javascript">
- console.log("Hello World!");
- </script>
- <% end %>
- <html>
- <head>
- <script type="text/javascript">
- console.log("Hello World!");
- </script>
- </head>
- <body>
- <div id="sidebar">
- This content will show up in the sidebar section
- </div>
- </body>
- def index
- @books = Book.all
- end
- def show
- @book = Book.find_by(id: params[:id])
- if @book.nil?
- render action: "index"
- end
- end
- def index
- @books = Book.all
- end
- def show
- @book = Book.find_by(id: params[:id])
- if @book.nil?
- redirect_to action: :index
- end
- end
- def index
- @books = Book.all
- end
- def show
- @book = Book.find_by(id: params[:id])
- if @book.nil?
- @books = Book.all
- flash.now[:alert] = "Your book was not found"
- render "index"
- end
- end
Add Comment
Please, Sign In to add comment