From: Mc Ieong Date: 2010-01-31T15:28:54+09:00 Subject: parameters.. Hi! I am a newbie in Ruby programming. I wrote the following functions and they works fine, but it seems very stupid of not using just one parameterized function to update the same fields(:first_name, :last_name), can everyone give me some hints about that ? def update_first_name if request.post? if !params[:data].nil? Employee.update(params[:id], :first_name => params[:data]) end end render(:nothing => true) end def update_last_name if request.post? if !params[:data].nil? Employee.update(params[:id], :last_name => params[:data]) end end render(:nothing => true) end Thanks in advance. Ieong -- Posted via http://www.ruby-forum.com/.