which variable to use
DiggBlinkRedditDeliciousTechnorati
question by imran | Easy
Im developing an application online ecam
my apps needs to put question on view and request for input
and doing same thing for a count
Please advice which variables to use i,e @@ or @ variables to store questions and count so that it will persist till session and then i can enter the q and ans in exam table
ALso tell how to store array in session so that i can retrieve each eleemnt using index
Post reply
Subscriptions
Re: which variable to usereply by spike If you're using rails it'd be session[:varname] = [1, 2, 3, 4] to store an array in a session.
As far as your first question goes. Usually it's an @ variable. If you use a model to model the questions etc... and build your form with the helpers, it should maintain persistant values for those entires. Otherwise you can get them from params[:fieldname] or params[:modelname][:fieldname]
Post reply
Subscriptions
Got a Ruby Question?
Just Sign Up and ask the top Ruby experts!
|