I\'m new to rails and ruby. I was studying the concept of class and instance variables. I understood the difference but when I tried it out using the controller in rails it got
Declaring the @insworld within the class but not in the constructor or any of the instance methods sets @insworld scoped to the instance of the class itself.
BooksController.instance_variable_get(:'@insworld')
If you need the access to variable inside of your index method, consider defining it within the method instead.