Nice, but there's a mistake in the controller/ model. The code appears to work because @users=User.all which matches the set of users computed within the model class
The correct call would be User.to_csv(@users). The User model function has to be modified to take the new parameter into account.
Nice, but there's a mistake in the controller/ model. The code appears to work because @users=User.all which matches the set of users computed within the model class
The correct call would be User.to_csv(@users). The User model function has to be modified to take the new parameter into account.
nope, it's right the way it is. Since @users is an
ActiveRecord::Relation
so you can say@users.to_csv