30 Dec '15, 10am

Building Cross Model Search with Ember, Part II - Ruby Elasticsearch, Rails

Building Cross Model Search with Ember, Part II - Ruby Elasticsearch, Rails

// app/services/search.js import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), searchValue: null, searchResults: [], resultsEmpty: false, noResults: Ember.computed('resultsEmpty', 'searchValue', function() { // ensure there is a search query and the results // are empty to prevent "No results for ''". if (this.get('resultsEmpty') && Ember.isPresent(this.get('searchValue')) && this.get('searchValue').length > 0) { return true; } else { return false; } }), results: Ember.computed('searchResults.[]', function() { return this.get('searchResults'); }), _fetchSearchResults: Ember.observer('searchValue', function() { // exit without making a reqeust if value cast is empty if (Ember.isBlank(this.get('searchValue'))) { return []; } this.get('store').query('search', { q: this.get('searchValue') }).then((results) => { // check if the query r...

Full article: http://www.webcodegeeks.com/ruby/building-cross-model-sea...

Tweets

#How do you refer an instance of a model in mod...

abizy.com 08 Jan '16, 10pm

We do not share, store or cache any illegal files on this blog. We only share digital contents those are licensed under “C...

#How do I validate text_field_tag when is not p...

abizy.com 12 Jan '16, 3am

We do not share, store or cache any illegal files on this blog. We only share digital contents those are licensed under “C...

TEXTURED CROSS STRAP SANDALS

charleskeith.com 29 Dec '15, 10pm

Open-toe faux fur cross strap sandals . Slingback strap fastens with a metal buckle closure. Material Description: Faux Fu...

Calls-to-action: The Do Part of Your Email Marketing #DigitalMarketing

Calls-to-action: The Do Part of Your Email Mark...

webmarketingtoday.com 30 Dec '15, 2pm

Imagine this. You book a fabulous ski vacation, fly to your destination, settle in at the lodge, take the ski lift to the ...

Tesla Model S Redesign Coming To Commonize With...

greencarreports.com 30 Dec '15, 12pm

Stephen Edelstein 938 views Dec 30, 2015 2016 Tesla Model S Enlarge Photo It's typical for carmakers to redesign a given m...

Are beacons the most disruptive force in mobile...

searchenginewatch.com 27 Dec '15, 2am

It’s a very interesting time for search marketers. Desktop and notebook search trends are settling into a predictable Mond...

No-Hype SEO: A Realistic Formula To Making SEO ...

searchengineland.com 29 Dec '15, 2pm

SEO (search engine optimization) has come a long way. After experiencing the “wrath of Google ” years ago, some marketers ...

Christmas London Tour – Part 4 https://t.co/9qo...

cabbieblog.com 29 Dec '15, 1pm

This is the second part of our Christmas Tour for this year and concludes the circular tour we started last December. No p...

How resilience will shape the future of building design

How resilience will shape the future of buildin...

greenbiz.com 29 Dec '15, 10am

Hurricanes, flooding droughts, wildfires, landslides and terrorism. These are the issues we’ll be addressing next in green...