Skip to content

Instantly share code, notes, and snippets.

@jeremywrowe
Created June 30, 2013 15:05
Show Gist options
  • Save jeremywrowe/5895495 to your computer and use it in GitHub Desktop.
Save jeremywrowe/5895495 to your computer and use it in GitHub Desktop.
render json: Resource.where(something: params[:something]).first_or_create do |r|
r.enabled = params[:enabled]
r.foo = params[:foo]
r.bar = params[:bar]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment