Last active
August 29, 2015 14:13
-
-
Save Bodacious/aaf4f3cca89c8bb721fa to your computer and use it in GitHub Desktop.
controller/views/intsance varialbes
This file contains hidden or 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
| # Bad: | |
| class OrdersController | |
| exposes :orders | |
| def index | |
| @orders = Order.complete | |
| end | |
| def pending | |
| @orders = Order.pending | |
| end | |
| end | |
| # Good: | |
| class OrdersController | |
| exposes :complete_orders, :pending_orders | |
| def index | |
| @complete_orders = Order.complete | |
| end | |
| def pending | |
| @pending_orders = Order.pending | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this rails 4 or 3?
What's the difference? In official guides they use the bad way.