From: Pete Moran Date: 2009-08-13T17:00:39+09:00 Subject: Simple If Sorry for total newbie question here - in a method a particular id could be passed as a variable or as part of the has - how what would be the equivalent in ruby of the following Perl ? my $id = (exists $hash->{id}) ? $hash->{id} : $_; Assuming that in Ruby (well Rails). The ID will either be in params[:id] or params[:country][:id] ? So if params[:country][:id] contains the value I assign that otherwise I assign params[:id] Thanks for helping my small brain! -- Posted via http://www.ruby-forum.com/.