Skip to content

Instantly share code, notes, and snippets.

@JRizzle88
Created November 30, 2013 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JRizzle88/7714662 to your computer and use it in GitHub Desktop.
Save JRizzle88/7714662 to your computer and use it in GitHub Desktop.
ERROR: relation "product_categories_products" does not exist LINE 1: DELETE FROM "product_categories_products" WHERE "product_cat...
<h3>Product Categories</h3>
<div class="large-4 columns">
<%= render 'form' %>
</div>
<div class="large-8 columns">
<table>
<thead>
<tr>
<th width="300">Name</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @product_categories.each do |product_category| %>
<tr>
<td><%= product_category.name %></td>
<td><%= link_to 'Edit', edit_admin_product_category_path(@product_categories) %></td>
<td><%= link_to 'Destroy', admin_product_category_path(product_category), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<br>
def destroy
@product_category.destroy
respond_to do |format|
format.html { redirect_to [:admin_product_categories, @product_categories] }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_product_category
@product_category = ProductCategory.find(params[:id])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment