Skip to content

Instantly share code, notes, and snippets.

@seanrucker
seanrucker / components.my-component.js
Last active May 9, 2016 15:27 — forked from cowboyd/components.my-component.js
Input Caret Position (single)
import Ember from 'ember';
export default Ember.Component.extend({
edited: false,
actions: {
setText(text) {
this.set('edited', true);
import Ember from 'ember';
export default Ember.Component.extend({
edited: false,
actions: {
setText(text) {
console.log('setText', text);
@seanrucker
seanrucker / components.my-component.js
Last active May 9, 2016 15:36
Input Caret Position (solution)
import Ember from 'ember';
export default Ember.Component.extend({
edited: false,
actions: {
setText(text) {
this.set('edited', true);
@seanrucker
seanrucker / components.my-component.js
Last active May 9, 2016 14:21
Input Caret Position
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setText(text) {
let message = this.get('message');
message = Ember.copy(message);
message.text = text;
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
focus() {
console.log('focus');
}
}
import Ember from 'ember';
export default Ember.Component.extend({
didRender() {
console.log('didRender');
console.log('pojo1', this.get('pojo1'));
console.log('pojo2', this.get('pojo2'));
}
});
@seanrucker
seanrucker / .tm_properties
Created July 29, 2015 17:06
TextMate 2 Properties for Ember project
extraExcludes = "bower_components,dist,hooks,node_modules,public,tests,tmp,vendor"
excludeInFileChooser = "{$excludeInFileChooser,$extraExcludes}"
excludeInFolderSearch = "{$excludeInFolderSearch,$extraExcludes}"
## Create A Visit
`POST /visits`
````javascript
{
uuid: "ABC123",
majorNumber: "12984",
customer: {
customerID: "800000516109",
<!-- app/views/inquiries/_form.html.erb
<%= form_for inquiry do |f| %>
<% if inquiry.errors.any? %>
<ul>
<% inquiry.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
<% end %>
<!-- app/views/inquiries/_form.html.erb -->
<%= form_for inquiry do |f| %>
<div>
<%= f.label :name %><br/>
<%= f.text_field :name %>
</div>
<div>
<%= f.label :email %><br/>