I'm working on an application that is basically an online store using Ruby on Rails. I have application.html.erb which holds a side with the basket that runs with Ajax. Once the checkout button is clicked it redirects the body of the page for the a new order form. I want the checkout button to desapear when that view is displayed. Any thoughts on how I could do it? Follows the code for the partial
views/baskets/_basket.html
<% unless basket.queue_groceries.empty? %>
<div class="basket"> Our basket</div>
<table>
<!-- START_HIGHLIGHT -->
<%= render(basket.queue_groceries) %>
<!-- END_HIGHLIGHT -->
<tr class="total_line">
<td colspan="2">Total</td>
<!-- START_HIGHLIGHT -->
<td class="total_cell"><%= number_to_currency(basket.total_price) %></td>
<!-- END_HIGHLIGHT -->
</tr>
</table>
<!-- START_HIGHLIGHT -->
<%= button_to 'Check out', new_order_path, method: :get %>
<%= button_to 'Empty basket', basket, method: :delete, confirm: 'Are you sure?' %>
And then the views/layouts/application.html.erb
<!-- START:head -->
<!DOCTYPE html>
<html>
<head>
<!-- START_HIGHLIGHT -->
<title>Pragprog Books Online Store</title>
<!-- END_HIGHLIGHT -->
<!-- <label id="code.slt"/> --><%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %><!-- <label id="code.jlt"/> -->
<%= csrf_meta_tags %><!-- <label id="code.csrf"/> -->
</head>
<!-- END:head -->
<body class="<%= controller.controller_name %>">
<!-- START_HIGHLIGHT -->
<div id="banner">
<%= image_tag("logo.png") %>
<%= @page_title || "Pragmatic Bookshelf" %><!-- <label id="code.depot.e.title"/> -->
</div>
<div id="columns">
<div id="side">
<div id="basket">
<%= render @basket %>
</div>
<ul>
<li><a href="http://www....">Home</a></li>
<li><a href="http://www..../faq">Questions</a></li>
<li><a href="http://www..../news">News</a></li>
<li><a href="http://www..../contact">Contact</a></li>
</ul>
</div>
<div id="main">
<!-- END_HIGHLIGHT -->
<%= yield %><!-- <label id="code.depot.e.include"/> -->
<!-- START_HIGHLIGHT -->
</div>
</div>
<!-- END_HIGHLIGHT -->
</body>
</html>