Skip to content

Instantly share code, notes, and snippets.

View mharris717's full-sized avatar

Mike Harris mharris717

View GitHub Profile
import Ember from 'ember';
export default Ember.Mixin.create({
changeOrder: function() {
this.get('model').setOtherParam('order',this.get('order'));
}.observes('order')
});
import Ember from 'ember';
import Mixin from './../../mixins/pagination';
export
default Ember.ArrayController.extend(Mixin, {
// setup our query params
queryParams: ["page", "perPage", "filter", "order"],
// setup orders
selOrders: [{
label: 'Recente',
value: 'created_at-asc'
class Client < ActiveRecord::Base
validates_presence_of :name, :zip, :address, :city, :phone_number
# only change the humanized text for zip and name. The other attributes will still be humanized
# just as they normally would.
HUMANIZED_COLUMNS = {:zip => "Postal code", :name => "Company contact name"}
def self.human_attribute_name(attribute)
HUMANIZED_COLUMNS[attribute.to_sym] || super
end