Everything I read says that view helpers get mixed into views, but which class, specifically do they get mixed into?
References:
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The controller has a
view_context, which is an instance ofview_context_class, which is (by default) an anonymous subclass ofActionView::Basecreated byActionView::Base.prepare. The helpers are mixed in to these view context classes.The view context is also the place where the controller instance variables “magically” become instance variables in the view.