Test if a string is an integer with Ruby

	<% if params[:page].is_a?(Integer) %>
		Nice
	<% else %>
		$#%@
	<% end %>

in irb

12.is_a?(Integer)
=> true

from Introduction to Ruby

Comments