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
303b764b
Commit
303b764b
authored
Oct 01, 2020
by
Aman Sharma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove print statements
parent
56adfb10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
4 deletions
+1
-4
recipes_controller.rb
app/controllers/api/v1/recipes_controller.rb
+0
-1
NewRecipe.jsx
app/javascript/components/NewRecipe.jsx
+1
-3
No files found.
app/controllers/api/v1/recipes_controller.rb
View file @
303b764b
...
@@ -6,7 +6,6 @@ class Api::V1::RecipesController < ApplicationController
...
@@ -6,7 +6,6 @@ class Api::V1::RecipesController < ApplicationController
def
create
def
create
recipe
=
Recipe
.
create!
(
recipe_params
)
recipe
=
Recipe
.
create!
(
recipe_params
)
print
recipe_params
if
recipe
if
recipe
render
json:
recipe
render
json:
recipe
else
else
...
...
app/javascript/components/NewRecipe.jsx
View file @
303b764b
...
@@ -115,9 +115,7 @@ class NewRecipe extends React.Component {
...
@@ -115,9 +115,7 @@ class NewRecipe extends React.Component {
})
})
.
then
(
response
=>
{
.
then
(
response
=>
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
alert
(
"AAAAAAAAAAA"
)
this
.
props
.
history
.
push
(
`/recipes`
)
// return response.json();
console
.
log
(
response
.
json
);
}
}
throw
new
Error
(
"Network response was not ok."
);
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