THE ZEPINT NETWORK

programmer assist

Ruby Ruby XML Feeds

Ruby Questions Ruby Solutions Ruby Articles

Ruby is a reflective, dynamic, object-oriented programming language. It combines syntax inspired by Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp, Dylan, and CLU. Ruby is a single-pass interpreted language. Its official implementation is free software written in C.

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 use

reply 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!

Search via Google

User Login

Email Address

Password

Ruby Experts

Rank Expert Points
#1 Srirangan 1500
This a list of the Top Ruby experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4600
#2 Bejaan 2900
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 400
#10 Huntress 150
#11 Adkron 150
#12 Yogesh 100
#13 lexxwern 100
#14 Mustan Khan 100
#15 Mahesh Kumar 100
This is a list of overall best performing experts, how many points do you have?