Reputation: 5005
{"test_url"=>"http://test.com/123.jpg"}
is my output from
<% @results.each do |t| %>
<%= t.image.extract!("test_url") %>
<% end %>
How can i just get the contents of test_url? so http://test.com/123.jpg
Upvotes: 0
Views: 82
Reputation: 2273
<% @results.each do |t| %>
<%= t.image["test_url"] %>
<% end %>
Upvotes: 1
Reputation: 156
#extract! always deletes and returns the key/value pairs for the given key from the Hash.
To delete and only return the value:
<%= t.image.delete("test_url") %>
or, if you just want to get the value:
<%= t.image["test_url"] %>
Upvotes: 4