Skip to content

Instantly share code, notes, and snippets.

@SoldierCoder
Created May 10, 2015 19:27
Show Gist options
  • Save SoldierCoder/9dd017aeae3b98cd0b43 to your computer and use it in GitHub Desktop.
Save SoldierCoder/9dd017aeae3b98cd0b43 to your computer and use it in GitHub Desktop.
class HumansController < ApplicationController
def create
human = Human.new(human_params)
if human.save
render json: human, status: 201, location: human
end
end
private
def human_params
params.require(:human).permit(:name, :brain_type)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment