Commit d2770ae9 by Vijay Gawariya

Merge branch 'master' of 35.155.93.82:amansharma/react-rails-rspec

parents b0553e06 56adfb10
......@@ -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