ruby on rails - how to create record via POST (using POSTMAN) -
I am new to the railways and started the guides. rubyonrails.org and now I am facing a problem with making a record.
I want to send this json: {"title": "someTitle", "text": "sometext"}
to
> in my model This definition is the only title and text field.
The root is also setup and looks like creating my controller method:
def make @article = article.new (article_params) if @ article.save redirect_to @Article And 'new' end-end private dig article pending parameters. I set POSTMAN to post method while requesting but I get this error message: Accessing the ActionController :: parameter ArticleController # create param is missing or the value is empty:
I believe that JSN should be:
< Code> {article: {title: "someTitle", text: "someText"}} tries to article_params article Finding the key of the name and not in your JSN Is it
Comments
Post a Comment