Skip to content

Instantly share code, notes, and snippets.

@marcgg
Last active December 21, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcgg/6222393 to your computer and use it in GitHub Desktop.
Save marcgg/6222393 to your computer and use it in GitHub Desktop.
class BankAccountController
def admin_index
@bbans = Bbans.all
end
def user_index
@bbans_user = current_user.bbans.all
end
end
# View user_index
@bbans.each{|b| puts b }
-> crash
-----------------
class BankAccountController
expose(:bbans){ Bbans.all }
expose(:bbans_user){ Bbans.all }
def admin_index
end
def user_index
end
end
# View user_index
bbans.each{|b| puts b }
-> works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment