daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest May 16th, 2018 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - Restful conventions:
  2. GET index
  3. POST create
  4. GET show
  5. PATCH update
  6. DELETE destroy
  7.  
  8. - GET is the only verb that runs in browser
  9. - When running Create, create method and use body params to make flexible. EXAMPLE:
  10.         @instancevariable = Model.new(
  11.                                      attribute1: params[:attribute1],
  12.                                      attribute2: params[:attribute2]
  13.                                       )
  14.         @instancevariable.save
  15.         render ‘blah.json.jbuilder’
  16.     end
  17. End
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top