i have this output from an api call
@output['products'][0]
=>
{"url"=>"http://omgili.com/ri/.wHSUbtEfZTzBH6c9Z4cI15_sA3Hthoy48U8beRZ_m5lA7IjRC07KAl_t9PZZTUpVyIElYRPNwESkpgWrFuLtCsKQ1Apdjx_jld142pfHUAdippyPkgHob2bwpktxkzZqvVelr3L3OOq9qp5XCHXEYkx1GYb0O_awd5Z8FnemrBnhIJ4ZIOaKn7WinS9k36LajW78ScZZFn
If you want to get what is the difference between two hashes, you can do
this:
result = {}
hash1.each {|key, value| result[key] = hash2[key] if hash2[key] != value }
puts result
or use a this hash1.to_a == hash2.to_a turning it to an array and compairing
those. or you could use to_s compar
Hi thanks for the reply id over looked that completely. what solved this
was @output['products'][0]['images'].first
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send a
On Wednesday, April 11, 2018 at 7:10:53 PM UTC+8, dasibre wrote:
>
> How are you looping through the result. When you say you are unable to
> loop through, what do you mean exactly, what error are you getting
>
>
Hi thanks for the reply. Ive been trying to loop through like so
<% @output['prod
In my pagecontentController i have index and show. for index its
def index
@keyword = "Arduino"
webhoseio = Webhoseio.new(' # { ENV [ ' APIKEY2 ' ] } ' )
@output = webhoseio.query('productFilter', {'q': @keyword})
end
def show
@output['products'][:id]
end
Hi Sergio id be very interested im average at rails but learn fast but i
work with arduino's and raspberry pi's quite often. One of my latest
projects was figuring out the best way to control a drone using 4g cellular
data a modified version of MultiWii.
My linkedin here https://www.linkedin.c
This may help
http://guides.rubyonrails.org/v2.3.11/active_record_querying.html
what is it you are trying to convert. Do you mean you wish to add a column
to your database to store information if so you would use your model and
migrations
--
You received this message because you are subscri
7 matches
Mail list logo