Skip to content

Instantly share code, notes, and snippets.

View eddie-ruva's full-sized avatar

Eddie Ruvalcaba eddie-ruva

  • Mountain View, CA
View GitHub Profile

Shopify Upgrow

Ruby on Rails is the framework of choice for web apps at Shopify. It is an opinionated stack for quick and easy development of apps that need standard persistence with relational databases, an HTTP server, and HTML views.

By design, Rails does not define conventions for structuring business logic and domain-specific code, leaving developers to define their own architecture and best practices for a sustainable codebase.

In fast product development teams, budgets and deadlines interfere with this architectural work, leading to poorly written business logic and complicated code that is very hard to maintain long term. Even when developer teams take the time to think about what a good architecture in Rails look like, this work is likely required to be done all over again when a new Rails app needs to be created.

This project aims to make it easier for both new and existing Rails apps to adopt patterns that are proven to make code more sustainable long term, and codebases easier to maintain an

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
firstName: 'First Name',
lastName: 'Last Name',
fullName: Ember.computed('firstName', function() {
import Ember from 'ember';
import { CALL_TO_ACTIONS } from '../top-card-constants';
export default Ember.Component.extend({
init() {
this._super(...arguments);
this.CALL_TO_ACTIONS = CALL_TO_ACTIONS;
this.callToActionClasses = this._deriveCallToActionClasses();
},
import Ember from 'ember';
export default Ember.Controller.extend({
tooltipsContent: {
pageViewCount: 'Hello!',
uniqueVisitorCount: 'Bye'
},
items: ['pageViewCount', 'uniqueVisitorCount', 'more']
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@eddie-ruva
eddie-ruva / controllers.application.js
Created November 22, 2017 02:01
Issue with helper
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
counter: 0,
myArray: Ember.A([1,2,3,4,5]),
actions: {
remove() {
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
myArrayOne: ['a', 'b', 'c', 'd'],
myArrayTwo: ['A', 'B', 'C', 'D'],
});
@eddie-ruva
eddie-ruva / components.my-component.js
Last active February 22, 2017 20:05
Toggle switch
import Ember from 'ember';
export default Ember.Component.extend({
isChecked: false,
actions: {
onChange() {
this.toggleProperty('isChecked');
this.sendAction('onInteraction');
}
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
currentValue: 'Initial value',
actions: {
myAction(inputValue) {
console.log(event);
this.set('currentValue', inputValue);
}