Skip to content

Instantly share code, notes, and snippets.

@Camusensei
Created March 1, 2014 22:45
Show Gist options
  • Save Camusensei/9298674 to your computer and use it in GitHub Desktop.
Save Camusensei/9298674 to your computer and use it in GitHub Desktop.
saveWidget: (widget, html, css, js) ->
if Session.requestCurrentUser()
widget =
snippets_attributes = []
snippets_attributes: [
{
id: html[0]
body: html[1]
file_name: html[2]
file_extension: 'html'
},{
id: css[0]
body: css[1]
file_name: css[2]
file_extension: 'css'
},{
id: js[0]
body: js[1]
file_name: js[2]
file_extension: 'js'
}
]
w = _baseWidgets.post widget
w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment