Created
April 10, 2012 13:49
-
-
Save benolee/2351509 to your computer and use it in GitHub Desktop.
decent_exposure and proffer
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
# This seems like it does exactly what decent_exposure does... | |
# app/controllers/people_controller.rb | |
class PeopleController < ApplicationController | |
helper_method :people | |
def index | |
end | |
private | |
def people | |
Person.all | |
end | |
end | |
# app/views/people/index.html.erb | |
<%= render people %> |
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
# This seems like it does exactly what proffer does... | |
# app/controllers/people_controller.rb | |
class PeopleController < ApplicationController | |
def index | |
render locals: { people: Person.all } | |
end | |
end | |
# app/views/people/index.html.erb | |
<%= render people %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, I think that's legit. I was under the impression that proffer ALSO explicitly kept the controllers from exporting instance vars, which is better than yours