Greetings, i want pass data to my view without using instace variables.
Usually I make renders to partials for pass local variables and
preventing use instace variables :
I have to ask... why are you so keen on avoiding instance variables?
Sorry, I am just curious because they are so widely the standard way of
passing data between controller and view. I actually don't know of any
other way but that might be simply that I never had a need.
I have to ask... why are you so keen on avoiding instance variables?
Sorry, I am just curious because they are so widely the standard way of
passing data between controller and view. I actually don't know of any
other way but that might be simply that I never had a need.
I just want work in a very modular way (OO mode). And I don't need than
all my variables have to be with public access, that's the reason
I just want work in a very modular way (OO mode). And I don't need than
all my variables have to be with public access, that's the reason
There is nothing wrong with passing instance variables to the view.
However, I do think its good practice to limit the number of variables
you use. If your passing a large number of variables they can
probably be wrapped into an object, then you can just pass the
object. For example: