Josselin wrote:
> I trying to use a range object from an array of ranges objects as a 
> parameter
> 
> 
>  my_range = [(0..2), (2..5), (5..10), (10..15), (15..25)]
> 
>  props = []
>  domains = Domain.find(:all)
>  # keep track of the number of domains
> @ props[0] = domains.nitems
>  k = params[:id]  # can be 0, 1 ,2,3,4
> 
>  1.step(domains.nitems,1) do |d|
>      props[d] = Proposition.find_by_range( ( my_range[k ] )  , ......... )
>      d = d.next
>  end
> 
> I got an error  :  can't convert String into Integer  in the line :
> props[d] = Proposition.find_by_range( ( my_range[k ] )  , ......... )
> 
> is is wrong ?
Here's a guess:  k is a String?  Array indices can only be Integers - 
try my_range[k.to_i].

-- 
Alex