Im creating plugin for limiting the ip, i have included the plugin name in my controller
Controller: class AdminController < ApplicationController
acts_as_ratelimit
def login session[:user_id] = nil if request.post? user = User.authenticate(params[:name], params[:password]) if user session[:user_id] = user.id redirect_to(:controller=>"products", :action => "new" ) else flash.now[:notice] = "Invalid user/password combination" end end end
my plugin was initialize properly but im facing the problem in getting the remote ip in my plugin code .
i have included the line request.remote_ip for getting the ip address, im facing the error us undefined method or variable as request
Is that any way to get the ip correctly.