Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. ...
  2. def create
  3. record = Record.new(record_params)
  4. if record.save
  5. render json: record
  6. else
  7. render json: record.errors, status: :unprocessable_entity
  8. end
  9. end
  10.  
  11. private
  12. def record_params
  13. params.require(:record).permit(:title, :amount, :date)
  14. end
  15. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement