I'd recommend you pick up Cody Fauser's RJS tutorial at O'Reilly. I'll put you on the right track. The way you're mixing Rails/Ruby with HTML/JS, Rails can't tell what to do with the pieces you're giving it.
Keep up to date with Rails on Twitter and This Week in Rails
Policies: Conduct, License, Maintenance, Security, Trademarks