Commit 4739c45d authored by r888888888's avatar r888888888

fixes #3729

parent 97887a32
module Moderator
class IpAddrsController < ApplicationController
before_action :moderator_only
respond_to :html, :json
def index
@search = IpAddrSearch.new(params[:search])
@results = @search.execute
respond_with(@results)
end
def search
......
<%= raw @results.map {|ip_addr, count| {ip_addr: ip_addr.to_s, count: count}}.to_json %>
\ No newline at end of file
<%= raw @results.map {|user, count| {user_id: user.id, count: count}}.to_json %>
\ No newline at end of file
<% if params[:search][:user_id].present? || params[:search][:user_name].present? %>
<%= render "ip_listing.json" %>
<% else %>
<%= render "user_listing.json" %>
<% end %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment