Advertisement
Guest User

Untitled

a guest
May 14th, 2015
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.47 KB | None | 0 0
  1. <p id="notice"><%= notice %></p>
  2. <h1>Listing Products</h1>
  3. <div class="container">
  4.   <div class="row">
  5.     <table>
  6.       <thead>
  7.         <tr>
  8.           <th>Name</th>
  9.           <th>Description</th>
  10.           <th colspan="3"></th>
  11.         </tr>
  12.       </thead>
  13.       <tbody>
  14.         <% @products.each do |product| %>
  15.           <tr>
  16.             <td><%= product.name %></td>
  17.             <td><%= product.description %></td>
  18.             <td><%= link_to 'Show', product %></td>
  19.             <td><%= link_to 'Edit', edit_product_path(product) %></td>
  20.             <td><%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  21.           </tr>
  22.         <% end %>
  23.       </tbody>
  24.     </table>
  25.     <div id="no-js-form">
  26.         <div class="col-md-12">
  27.           <div class="col-md-4"></div>
  28.           <div class="col-md-4 align"> <a><button class="btn btn-success my_button" id="align" > <%= link_to 'New Product', new_product_path %></button></a></div>
  29.         </div>
  30.       </div>
  31.     </div>
  32.   </div>
  33.       <div id="yes-js-form">
  34.         <div class="container">
  35.           <div class="row">
  36.              <div class="col-md-12">
  37.                 <div class="col-md-4"></div>
  38.                 <div class="col-md-4 yes-js-button"> <a><button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target="#myModal"> New Product
  39.               </button></a></div>
  40.              </div>
  41.          </div>
  42.         </div>
  43.       </div>
  44.           <!-- Modal -->
  45.         <div class="my_modal">
  46.           <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  47.             <div class="modal-dialog">
  48.               <div class="modal-content">
  49.                 <div class="modal-header">
  50.                   <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  51.                   <h4 class="modal-title" id="myModalLabel">Add Product</h4>
  52.                 </div>
  53.                 <div class="modal-body">
  54.                    
  55.                        
  56.                
  57.                     <h1>New Product</h1>
  58.                     <%= render 'form' %>
  59.                    
  60.  
  61.  
  62.  
  63.                 </div>
  64.               </div>
  65.             </div>
  66.           </div>
  67. <script type="text/javascript">
  68.   document.getElementById("yes-js-form").style.display='block';
  69.   document.getElementById("no-js-form").style.display='none';
  70. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement