Skip to content

Instantly share code, notes, and snippets.

@RHMason
Created February 11, 2020 08:47
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 RHMason/1bcdda96b9d3cf115a46770d5b2d33fc to your computer and use it in GitHub Desktop.
Save RHMason/1bcdda96b9d3cf115a46770d5b2d33fc to your computer and use it in GitHub Desktop.
CFC for Nuxt form example
<cfcomponent extends="taffy.core.resource" taffy:uri="/nuxtPreso">
<cfheader name="Access-Control-Allow-Origin" value="*">
<cfheader name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE" />
<cfheader name="Access-Control-Allow-Headers" value="Content-Type" />
<cffunction name="post" access="remote" output="true">
<cfargument name = "title" default="" required="true">
<cfargument name = "title2" default="" required="true">
<cfargument name = "title3" default="" required="true">
<cfset var local = {} />
<cfquery name="local.nuxtCreate" datasource='mmcfugpreso'>
INSERT INTO nuxtPreso (name,company,email)
VALUES (
'#title#',
'#title2#',
'#title3#'
)
</cfquery>
<cfreturn NoData() />
</cffunction>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment