P
Pete Moran
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!
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!