From: Alen Alen Date: 2011-09-22T03:22:51+09:00 Subject: Arrays and choose one Hi!! I am newbie on ruby and I have questions and troubles, can you help me out? This is the html and the view [code] [/code] The idea is to choose only one and that one show another list box with some results, for example: I want an audi, I selected the audi and then another list box shows the types of audi: sedan, coupe,..... This the code I have: [code] def type @audi=Array.new @audi=['audi 1','audi 2','audi 3','audi 4'] @bmw=Array.new @bmw=['bmw 1','bmw 2','bmw 3','bmw 4'] @dodge=Array.new @dodge=['dodge 1','dodge 2','dodge 3','dodge 4'] @nissan=Array.new @nissan=['nissan 1','nissan 2','nissan 3','nissan 4'] @renault=Array.new @renault=['renault 1','renault 2','renault 3','renault 4'] @type=params[:select] option=@type case option when audi puts @audi when bmw puts @bmw when dodge puts @dodge when nissan puts @nissan when renault puts @renault end end [/code] This code is bad?, good?, something are missing.? thanks for the help -- Posted via http://www.ruby-forum.com/.