I am trying to pull images from the instagram API in my rails app and am currently getting an error:

```
undefined local variable or method 'search'

```

**My view**

```
<div class="container">
        <div class="row">
            <% search.each do |instagram| %>
            <%= image_tag instagram.images.low_resolution.url %>
            </div>
            <% end %>
        </div>

```

**My controller**

```
  class PagesController < ApplicationController

  def home
    access_token = "hidden"
    client = Instagram.client(access_token: access_token)
    default_search = client.tag_search('travel')
    search_query = client.tag_search(params[:q])

   if params[:q]
        search_query = client.tag_search(params[:q])
        @tag = search_query.present? ? search_query : default_search
    else
      @tag = tag.first.name
      @search = client.tag_recent_media(@tag)
  end

end
  def about
  end
end

```