Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
react-rails-rspec
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aman Sharma
react-rails-rspec
Commits
d2770ae9
Commit
d2770ae9
authored
Oct 01, 2020
by
Vijay Gawariya
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 35.155.93.82:amansharma/react-rails-rspec
parents
b0553e06
56adfb10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
recipes_controller.rb
app/controllers/api/v1/recipes_controller.rb
+2
-3
NewRecipe.jsx
app/javascript/components/NewRecipe.jsx
+2
-1
No files found.
app/controllers/api/v1/recipes_controller.rb
View file @
d2770ae9
...
...
@@ -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
...
...
app/javascript/components/NewRecipe.jsx
View file @
d2770ae9
...
...
@@ -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."
);
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment