Skip to content

Instantly share code, notes, and snippets.

template: _.template "<a href='/users/<%= user_id %>/albums/<%= id %>'><%= title %></a><button class='unfeature'>Unfeature&nbsp;&times;</button>"
Album.first.update_attribute(:featured, true)
App.albums.where({ title: 'A Love Supreme' });
Object {Models: Object, Collections: Object, Views: Object}
Object {VERSION: "1.1.2", $: function, noConflict: function, emulateHTTP: false, emulateJSON: false…}
$('#featured').append(a.render().el);
$ ->
App.albums.fetch
success: ->
App.albumsListView.hideLoader().setPlaceholder()
App.Views.AlbumsListView = Backbone.View.extend
hideLoader: -> $('.loading').hide(); this
$ ->
App.albums.fetch
success: ->
$('.loading').hide()
App.albumsListView.setPlaceholder()
-# app/views/albums/index.html.haml
.featured-albums.panel
%h3 Featured Albums
%p.loading
%span.text Loading featured albums
%span.loader
%ul#featured{ data: { 'user-id' => params[:user_id] } }