Commit 56adfb10 by Aman Sharma

Added file and server

parent e0e4d1c7
......@@ -34,9 +34,8 @@ class Api::V1::RecipesController < ApplicationController
name = doc.search('NAME').text
ingredients = doc.search('INGREDIENTS').text
instruction = doc.search('INSTRUCTION').text
Recipe.create!(name: name, ingredients: ingredients, instruction: instruction)
# Recipe.create!(recipe_params)
render json: { msg: 'OK' }
recipe = Recipe.create!(name: name, ingredients: ingredients, instruction: instruction)
render json: recipe
end
private
......
......@@ -116,7 +116,8 @@ class NewRecipe extends React.Component {
.then(response => {
if (response.ok) {
alert("AAAAAAAAAAA")
return response.json();
// return response.json();
console.log(response.json);
}
throw new Error("Network response was not ok.");
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment