Commit 56adfb10 by Aman Sharma

Added file and server

parent e0e4d1c7
...@@ -34,9 +34,8 @@ class Api::V1::RecipesController < ApplicationController ...@@ -34,9 +34,8 @@ class Api::V1::RecipesController < ApplicationController
name = doc.search('NAME').text name = doc.search('NAME').text
ingredients = doc.search('INGREDIENTS').text ingredients = doc.search('INGREDIENTS').text
instruction = doc.search('INSTRUCTION').text instruction = doc.search('INSTRUCTION').text
Recipe.create!(name: name, ingredients: ingredients, instruction: instruction) recipe = Recipe.create!(name: name, ingredients: ingredients, instruction: instruction)
# Recipe.create!(recipe_params) render json: recipe
render json: { msg: 'OK' }
end end
private private
......
...@@ -116,7 +116,8 @@ class NewRecipe extends React.Component { ...@@ -116,7 +116,8 @@ class NewRecipe extends React.Component {
.then(response => { .then(response => {
if (response.ok) { if (response.ok) {
alert("AAAAAAAAAAA") alert("AAAAAAAAAAA")
return response.json(); // return response.json();
console.log(response.json);
} }
throw new Error("Network response was not ok."); 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