Skip to content

Instantly share code, notes, and snippets.

@JackPott
Created January 12, 2014 15:58
Show Gist options
  • Save JackPott/8386397 to your computer and use it in GitHub Desktop.
Save JackPott/8386397 to your computer and use it in GitHub Desktop.
before_action :set_project, only: [:show, :edit, :update, :destroy]
#snip....
# GET /projects/1/edit
def edit
end
#snip...
private
# Use callbacks to share common setup or constraints between actions.
def set_project
@project = Project.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def project_params
params.require(:project).permit(:name, :designer)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment