Skip to content

Commit

Permalink
Merge pull request lighthouse-labs#7 from adrianmc/product-create-bugs
Browse files Browse the repository at this point in the history
Product creation bug fixes
  • Loading branch information
kvirani authored Nov 7, 2016
2 parents a64b91b + 8ad451b commit 785e264
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def create
@product = Product.new(product_params)

if @product.save
redirect_to [:admin, products], notice: 'Product created!'
redirect_to [:admin, :products], notice: 'Product created!'
else
render :new
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/products/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<div class="form-group">
<%= form.label :category %>
<%= form.select :category, options_from_collection_for_select(Category.all.order(:name), :id, :name), { include_blank: true }, class: 'form-control' %>
<%= form.select :category_id, options_from_collection_for_select(Category.all.order(:name), :id, :name), { include_blank: true }, class: 'form-control' %>
</div>

<div class="form-group">
Expand Down

0 comments on commit 785e264

Please sign in to comment.