Skip to content

Instantly share code, notes, and snippets.

View mockra's full-sized avatar

David Ratajczak mockra

View GitHub Profile
{{ errors.email }}
<div class="form-group">
{{input type="text" value=searchText placeholder="Search..."}}
</div>
{{updateResults}}
{{#each searchResults}}
<li>{{this}}</li>
{{/each}}
import Ember from 'ember';
export default Ember.Controller.extend({
searchText: null,
searchResults: [],
updateResults: function() {
var self = this;
var searchText = self.get('searchText');
import Ember from 'ember';
export default Ember.Controller.extend({
searchText: null,
searchResults: function() {
var searchText = this.get('searchText');
if (!searchText) { return; }
return this.store.find('post', {name: searchText});
import Ember from 'ember';
export default Ember.ObjectController.extend({
actions: {
create: function(post) {
var self = this;
var comment = this.store.createRecord('comment', {
post: post,
content: this.get('content')
});
{
"comment": {
"id": 11,
"content": "this is my comment",
"post_id": 2
}
}
function googlePlacesInitialize() {
var inputs;
inputs = $('input[data-google-places]');
return $.each(inputs, function() {
return new google.maps.places.Autocomplete(this, {
types: ['geocode'],
componentRestrictions: {
country: 'us'
}
});
task :cron => [ :environment, :email ] do
end
task :email do
if Time.now.hour % 6 == 0
# Send Email
end
end
var request = require('supertest')
var Post = require('../../models/post')
describe('Posts Controller', function() {
describe('index', function() {
it('retrieves posts', function(done) {
new Post({
title: 'Test Post',
content: 'Test Content'
}).save()
import { test, moduleForComponent } from 'ember-qunit';
moduleForComponent('gravatar-image', 'GravatarImageComponent', {
});
test('it renders with size and e-mail', function() {
var component = this.subject();
Ember.run(function(){
component.set('size', 400);