Created
November 30, 2013 02:31
-
-
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...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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