no implicit conversion of Symbol into Integer (RAILS)

0

I'm collecting data from a cinema web services and I want to get the movies, but I get an error:

  

no implicit conversion of Symbol into Integer

This is the function in controller :

 def set_movies
    prepare_client_soap
    @response = [];
    [email protected][:fecha]
    dates.each do |date|
      message={:user => ,
               :password => ,
               :id_fecha => 
      }
      [email protected](:get_peliculas, message: message)
      response= response.to_hash
      @response.push(response[:get_peliculas_response])
    end
    @response_array = [];
    @response.each do |response|
      movies=response[:return][:pelicula]
      movies.each do |movie|
        @response_array.push(movie)
      end
    end
    @movies=@response_array
  end

In my HTML :

[email protected] do |movie|
  =movie[:pelicula]
    
asked by dannaandroid 03.02.2017 в 15:45
source

1 answer

0
@response.each do |response|
 movies=response[:return][:pelicula]
 movies.each do |movie|
   @response_array.push(movie)
 end
end

Check your movies variable if it is an array movies.kind_of? (Array) you may find that your result is an object and not an array

    
answered by 03.02.2017 / 17:44
source