Skip to content

Instantly share code, notes, and snippets.

@MaryKuz
Created March 28, 2019 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryKuz/dbf2234c17f3ba2551937b5f97a05da2 to your computer and use it in GitHub Desktop.
Save MaryKuz/dbf2234c17f3ba2551937b5f97a05da2 to your computer and use it in GitHub Desktop.
Plan API architecture
class ApplicationController < ActionController::Base
...
def new
initialize_resource
end
def create
build_resource
resource.save!
end
def update
resource.update! resource_params
end
def destroy
resource.destroy!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment