Displaying 20 results from an estimated 900 matches similar to: "can't call request.remote_ip from object?"
2008 Feb 24
1
Problems with request.remote_ip
Hello everyone,
I am trying to use request.remote_ip in my application to log a user''s
IP address because I have been having a lot of abuse issues. basically
when a user logs I simply call user.update_attribute(:last_ip,
request.remote_ip). The problem is that for some reason a lot of people
that have recently logged in still have NULL listed as their last_ip in
the database, even
2007 Jul 09
7
request.remote_ip
Hi,
How can i access to request.remote_ip in a model?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2007 Nov 23
4
help! problem with mongrel, request.remote_ip and lighttpd
I have an existing rails application on lighttpd and I am trrying to upgrade
to mongrel for the enhanced scalability it offers.
I am running mongrel 1.1.1, rails 1.2.5, lighttpd 1.4.13 and ruby 1.8.5
Everything is working great except request.remote_ip returns 127.0.0.1 or
192.168.0.102 (the internal network address of the server running lighty).
I''ve seen some older posts about
2007 Jul 17
12
Getting past my login system
Thank you in advance for your help. I am relatively new to both Rails
and Rspec and I am hoping for some insight from some experienced veterans.
Right now I am using Rspec for code that has already been written so
that additional functionality can be developed using the BDD method. My
problem shows up when I try to spec controllers that are behind the
login system. Each page checks for the
2007 Nov 23
2
Unable to read anything from request.remote_ip
For some users, request.remote_ip always return nil. According to the
RAILS''s help:
REMOTE_ADDR is the standard but will fail if the user is behind a proxy.
HTTP_CLIENT_IP and/or HTTP_X_FORWARDED_FOR are set by proxies so check
for these before falling back to REMOTE_ADDR. HTTP_X_FORWARDED_FOR may
be a comma- delimited list in the case of multiple chained proxies; the
first is the
2008 Sep 03
1
request.remote_ip returns kok + ip
What is this? When I use request.remote_ip in my rails app and print it
to a web page it says "kok" and then the ip. What is that word there
for?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi
I just did an update to lates trunk
=================
context "Given a generated venue_spec.rb with fixtures loaded" do
fixtures :venues
specify "fixtures should load two Venues" do
Venue.should have(2).records
end
end
==================
gives me
==========
1)
TypeError in ''Given a generated venue_spec.rb with fixtures loaded
fixtures should load two
2010 Mar 02
1
request.remote_ip with AJAX
Hello everyone. I have a problem with "request.remote_ip" I made an
array:
1 ip = request.remote_ip
2 $ address [ip] = (: test => "OK")
...
...
...
11 ip = request.remote_ip # (along with a lot of AJAX calls)
12 response = $ address [ip] [: test]
It often works, but sometimes it gives me this error:
NoMethodError (undefined method `[] ''for nil:
2006 Jul 08
2
Creating/Saving dependent objects
Folks,
Am new to RoR and am building an example to get myself familiar. I am
running into a simple issue while creating a user registration page.
I have a User and Address models defined as below (partial/relevant code
included below). User has_one address and Address belongs_to user. I have a
foreign key defined in address table that refers to user(id)
In a form I take in username, password,
2008 Jul 28
0
Re: remote_ip always returns 127.0.0.1 (apache)
On Mon, Jul 28, 2008 at 3:09 PM, Luca Scaljery
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
> I have my webrick server behind apache (all on the same server). The
> problem I have now is that request.remote_ip always returns 127.0.0.1.
> So it gets this IP from apache (I guess). How do I get the true client
> IP address
request.env[
2010 Mar 24
2
Mock "Consent_6335" received unexpected message :marked_for_destruction? with (no args)
I have a mock object (Person) that is associated with another object
(my_object) through a belongs_to association. When I check whether
my_object is valid (my_object.should be_valid), I am getting an error
like the following:
Mock "Person_6338" received unexpected
message :marked_for_destruction? with (no args)
Checking the list of methods on the mock,
2009 Aug 10
12
v2.0 configuration parsing
I'm trying to figure out how exactly v2.0 should be parsing
configuration files. The most annoying part is if it should always just
"use whatever comes first in config" or try some kind of a "use most
specific rule". The "most specific" kind of makes more sense initially,
but then you start wondering how to handle e.g.:
1) User logs in to imap from 192.168.0.1.
2010 Dec 10
5
Icecast source with updateable metadata?
Hello everyone,
I'm not new to Icecast, but I've always used Darkice. A new project
friends and myself are building for fun utilizes a Rivendell automation
setup that will run on one computer, then a source client for icecast on a
2nd computer with a mixer inbetween.
I'm looking to push the title information from the Rivendell system over
to the system that will have the
2011 May 21
4
request.format = :mobile causes error "undefined method `ref' for nil:NilClass"
I have a strange problem with setting request.format = :mobile
I can reproduce this problem on a completely fresh Rails 3.0.7 app
with no special gems. This seemed to work well in Rails 2 but for some
reason is hiccuping here, not sure what''s different in Rails 3 that
makes this hiccup. If you look at the stack track, it doesn''t even
pass through my app stack once -- weird --
2009 Aug 21
2
Requesting a remote ip in plugin
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 =>
2011 Aug 29
32
Weird assignment problem, very confused :(
Hey, I have the following line in my controller:
User.create(:email => "fuuu-+RB1Aph5k6s@public.gmane.org", :password =>
''asldfkjadsfadsf'', :ip => request.remote_ip)
my IP is 127.0.0.1 - now User.find_by_ip(''127.0.0.1'') returns 0
records although User.first contains ''127.0.0.1''
if I change it to:
User.create(:email =>
2010 Oct 28
3
SIP client floods port 5060 and gets blocked
Hello,
Is there any reason why an IP-phone would pounder on port 5060 ? My
firewall blocks the public IP because it thinks the remote IP is port
scanning on port 5060.
I think the phone is just registering but for some reason it does this
repeatedly in a very short time.
Oct 28 09:01:48 astserver kernel: Firewall: *UDP_IN Blocked* IN=eth0
OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:00:00
2008 Apr 29
1
Spec''ing controller macros
Hi,
(This is my first post after months of appreciative lurking...)
I''m trying to spec the following conditional controller macro:
class ApplicationController < ActionController::Base
# turn off session management for robots
session :off, :if => lambda {|req| req.user_agent =~ /(Google|Slurp)/i }
# ...
end
My current attempt seems to be quite unsuccessful:
1) when I
2020 Aug 25
2
Metric label values truncated when using OpenMetrics endpoint
Hi Jeff,
Thanks for your reply!
Regarding grouping by remote address, I understand and for now I'll keep a close eye. Maybe it's an option to group by /24 for ipv4 and /64 for IPv6? We currently do that based on the logs but the OpenMetrics endpoint seem a lot easier.
A slight hijack of the original question: but I tried to log only IP addresses (+ result) of failed login attempts but
2006 Jul 31
2
is it possible to make to_xml use underscore instead of dash?
Hi all,
I am getting ActiveRecord to produce XML with
render :xml => @user.to_xml
However, on the client end it is a bit annoying for me to deal with
attributes like first-name. I would much rather have first_name.
Is there any way for me to turn off the behavior of converting _ to -?
This seems to be done by a call to dasherize inside the to_xml of