Skip to content

Instantly share code, notes, and snippets.

@jorgegorka
Last active August 29, 2015 14:23
Show Gist options
  • Save jorgegorka/33ef0c9e4ba6af3eb92b to your computer and use it in GitHub Desktop.
Save jorgegorka/33ef0c9e4ba6af3eb92b to your computer and use it in GitHub Desktop.
New Message Form
NewMessageForm = React.createClass
handleSubmit: (e) ->
e.preventDefault()
description = React.findDOMNode(@refs.description).value.trim()
return unless description
Messages.insert({description: description})
React.findDOMNode(@refs.description).value = ''
render: ->
<div className="panel-footer">
<form onSubmit={@handleSubmit}>
<div className="input-group">
<input type="text" className="form-control input-sm" ref="description" placeholder="Type your message here..." />
<span className="input-group-btn">
<button className="btn btn-warning btn-sm">
Send Message
</button>
</span>
</div>
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment