In a rails view (be it erb or html or whatever), there are ruby variables accessible within the view. What defines the scope of the view? Is it whatever variables are within the scope of the controller's function being called?
Asked
Active
Viewed 319 times
1 Answers
0
It is whatever instance variables are declared in your controller plus any instance variables that may be set in your application controller via a before_filter.

Catfish
- 18,876
- 54
- 209
- 353
-
In addition: Ruby global variables, and any local, etc. variables defined in the scope(s) of the view itself. Also, see the answers in: http://stackoverflow.com/questions/228648/how-do-you-list-the-currently-available-objects-in-the-current-scope-in-ruby – Gary S. Weaver Feb 08 '13 at 22:45