1class Admin::TrendingIpsController < Admin::AdminController
 
2  before_action :fetch_petition
 
3  before_action :fetch_trending_ips
 
4
 
5  def index
 
6    respond_to do |format|
 
7      format.html
 
8    end
 
 9  end
 
 
11  private
 
 
13  def fetch_petition
 
14    @petition = Petition.find(params[:petition_id])
 
15  end
 
 
17  def fetch_trending_ips
 
18    @trending_ips = @petition.trending_ips.search(params[:q], page: params[:page])
 
19  end
 
20end