Created
July 23, 2013 06:58
-
-
Save elenawalom/6060345 to your computer and use it in GitHub Desktop.
Wk6Day1Notes
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
Project Redux | |
Where does stuff go? | |
Refactoring | |
Code Reviews | |
PM Javascript Review | |
Foreman | |
**Discussion about where to put javascript (script tag/file) | |
**API calls | |
**3rd party widgets/CSS/JS | |
**Random method | |
**Architecture | |
**Style sheet management | |
**How do we encapsulate cuntionality? | |
The goal of encapsulation is making sure that code is only where it really belong and only exposed thru interface and hidden to outside world | |
View - content of page minus header and footer (which are in Main) knows how to render stuff; how things are laid out; show content. View only knows what the controller tells it. Actions& instance variables in the controller tell views what to do | |
Helper - Modules/classes that do useful things that may have no logical home. How does the view know about helpers? View knows about helpers thru rails magic. General purpose fuctions used across the application. Scoring | |
Partial - is an HTML snippet | |
Controller - capture information. Keep the controller lean. Does API calls as response from a route. (API calls go in the controller) | |
When to use helpers vs. | |
Routes config | |
--> controller method | |
Controller responds to routes. Routes map to controllers. And controller calls out to API. | |
Use: score, transform, and compute for API calls. | |
Does view know about models? No. But controller does. | |
Model: encapsulates data & provides to the controller and object oriented view. | |
***What sorts of methods go into a model? | |
What is difference between score method in helper vs. score method in API? | |
APIs | |
Data | |
public | |
calculate () | |
score () | |
private is the keyword in Ruby | |
method = private def my_method | |
API calls controller | |
Random methods (helper or model) | |
How to organize CSS in view. | |
Foreman is a development tool | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment