title: How to display array data from Ajax in HTML (in Laravel 4.1)
body: <p>I am making an Ajax call to a controller that is returning back array data to my view.  I want to take this array data and have it displayed in HTML on the click.  I am not sure how to do this.  This is what I have so far:</p>
  
  <p>Ajax call:</p>
  
  <pre><code>request = $.ajax({ 
            url: "/fans/follow", 
            type: "post", 
            dataType: 'json',
            success:function(data){
              console.log(data);
  
            }, 
            data: {'id': id} ,beforeSend: function(data){
              console.log(data);
            } 
          });
  </code></pre>
  
  <p>Controller function: </p>
  
  <pre><code>public function follow() {
  
              $user_id = Auth::user()-&gt;get()-&gt;id;
              $fan_id = Input::get('id');
  
              $follow_array = Fanfollow::follows(Auth::user()-&gt;get()-&gt;id,0,7);
  
              return Response::json( $follow_array );
          }
  </code></pre>
  
  <p>follows function in my Fanfollow model:</p>
  
  <pre><code>public static function follows($user_id, $start = 0, $number_of_posts = 7) {
          $follows = DB::table('fanfollows')
                   -&gt;join('fanartists', 'fanfollows.fan_id', '=', 'fanartists.fan_id')
                   -&gt;join('fans', 'fanfollows.fan_id', '=', 'fans.id')
                   -&gt;join('artists', 'fanartists.artist_id', '=', 'artists.id')
                   -&gt;orderBy('fanartists.created_at', 'DESC')
                   -&gt;where('fanfollows.user_id', '=', $user_id)
                   -&gt;take($number_of_posts)
                   -&gt;offset($start)
                   -&gt;select(DB::raw('DATE_FORMAT(fanartists.created_at, "%M %d %Y") as created_at, fans.id, fans.first_name, fans.last_name, fans.gender'))
                   -&gt;get();
  
          return $follows;
  
      }
  </code></pre>
  
  <p>Basically I want to take the data returned by the follows function in my model to the view and have it printed.  </p>
  
  <p>The console.log(data) after the success is printing out [Object, Object, Object, Object, Object, Object, Object]</p>
  
  <p>where clicking further shows that each object is indeed the correct "row" of array data.  How do I take this data and have it displayed in HTML?</p>