This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Mixin.create({ | |
changeOrder: function() { | |
this.get('model').setOtherParam('order',this.get('order')); | |
}.observes('order') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |