Created
September 29, 2015 19:50
-
-
Save sighmin/9071c70e9db7f58c153c to your computer and use it in GitHub Desktop.
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 DashboardView | |
def initialize(current_user, users, featured_posts) | |
@current_user = current_user | |
@users = users.map { |u| UserView.new(u) } | |
@featured_posts = featured_posts | |
end | |
attr_reader :current_user, :users, :featured_posts | |
end | |
# Instantiate this in your controller layer and pass it to the view as the only "source of truth" for the data on the page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment