Skip to content

Instantly share code, notes, and snippets.

@benolee
Created April 10, 2012 13:49
Show Gist options
  • Save benolee/2351509 to your computer and use it in GitHub Desktop.
Save benolee/2351509 to your computer and use it in GitHub Desktop.
decent_exposure and proffer
# 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 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 %>
@knewter
Copy link

knewter commented Apr 10, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment