controllers: declare search_params helper in app controller.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
include Pundit
|
include Pundit
|
||||||
|
helper_method :search_params
|
||||||
|
|
||||||
class ApiLimitError < StandardError; end
|
class ApiLimitError < StandardError; end
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
class BansController < ApplicationController
|
class BansController < ApplicationController
|
||||||
respond_to :html, :xml, :json
|
respond_to :html, :xml, :json
|
||||||
helper_method :search_params
|
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@ban = authorize Ban.new(permitted_attributes(Ban))
|
@ban = authorize Ban.new(permitted_attributes(Ban))
|
||||||
|
|||||||
@@ -24,10 +24,4 @@ class IpBansController < ApplicationController
|
|||||||
@ip_ban.destroy
|
@ip_ban.destroy
|
||||||
respond_with(@ip_ban)
|
respond_with(@ip_ban)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def search_params
|
|
||||||
params.fetch(:search, {}).permit(%i[ip_addr order])
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user