A
A
Alex2015-11-28 12:18:16
Ruby on Rails
Alex, 2015-11-28 12:18:16

What is causing the 500 (Internal Server Error) error?

I am writing a small CRUD application using Rails/Angular.
WHEN I try to create or update data, 500 (Internal Server Error) pops up
, I use gem 'inherited_resources' so as not to write all the actions myself!
this is my controller

class ProductsController < InheritedResources::Base
  respond_to :json
end

But when all the actions in the controller are written manually, everything works!!!
What could be the reason???

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex, 2015-11-29
@sashasoft

added the following to the controller

private
    def permitted_params
      params.permit(:product => [:name, :description, :price])
    end
and everything worked

T
TyzhSysAdmin, 2015-11-28
@POS_troi

The answer to your question is in the development log of your APP

V
vsuhachev, 2015-11-28
@vsuhachev

here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question