Displaying 20 results from an estimated 4000 matches similar to: "rspec and cookies"
2006 Dec 01
2
Mongrel 0.3.18, rails 1.1.6 and cookies
I''ve run into an issue with my rails application being unable to
properly set cookies on Mongrel 0.3.18. If I run the simplified code
below in Mongrel 3.14.4, both cookies are properly sent to and saved
by the browser. With the same code in 0.3.18, only the auth_token
cookie is created (if I switch them, only the userid as it will only
properly create the first cookie in the list.)
2012 Apr 25
8
showing error (gsub) when switching from session to cookies
I am newbie to rail. Trying to develop social networking site so working
with railspace application. Everything is working fine but I stuck in
the problem when i am giving the authorization tocken to the user to
remember him/her.
My Error and controller code is below
Error:-
private method `gsub'' called for 4:Fixnum
C:/Users/Amir/Downloads/IR/ruby/lib/ruby/1.8/cgi.rb:342:in
2006 Mar 06
2
Cookies & gsub ?
I''m looking to store the current params into a/some cookie(s).
This works:
@params.each_pair do |this_index, this_param|
cookies[this_index] = this_param
end
Except, I get session-only cookies. This doesn''t work:
@params.each_pair do |this_index, this_param|
cookies[this_index] = {
:value => this_param,
:expires => 30.days.from_now
}
end
2009 Jul 02
2
Big help with shared subdomains cookies
Hi, i need that all the subdomains of an app (using subdomain_fu) use
''.domain.com'' as domain for all cookies.
I''ve set ActionController::Base.session_options[:domain] = ''.domain.com''
and it works...for just the session... how can i set this also for
common cookies ? (created with cookies[:name] = {:value => value,
:expires => 6.months.from_now} )
2008 Aug 30
3
Working with sessions in beast forum
Hey,
I''m designing an app which displays the events near a user in RoR. I''m
using the beat forum to facilitate user management/sessions/etc. I''ve
edited the sessions table in the Beast database to contain a
"session_location" value and what I''d like to do is to set this to the
users location when they log in. This would allow them to change their
2006 Jan 27
3
Problem setting multi-value cookie
I''m trying to set a multi-value cookie but for some reason it''s not
working. Any help would be appreciated.
cookies[:user] = { :value => {:email=>params[:login][:email],
:passwd=>params[:login][:passwd]}, :expires => 30.days.from_now, :path
=> "/login"}
--
Thiago Jackiw
2006 Feb 11
2
Session ID in a cookie?
I''ve been looking around for how to store the session ID in a cookie.
The "Agile Web Development with Rails" books seems to indicate that this
is done by default with Rails. But I don''t see a cookie being set in my
browser. (yeah, they''re enabled)
I poked through the RForum code to find something referencing "cookies"
but nothing came up.
Does
2006 Aug 15
4
Cookies and Ruby???
When someone comments on my site, I would like to store the user''s name
as a cookie, and display it the next time they return. I really don''t
know how to do this. Does this use the cgi library? As most things
with ruby, I would imagine it to be quite simple... could anyone post a
code snippet as to how this would work??? Thanks...
--
Posted via
2006 Apr 05
0
cookies not deleting?????
I was running into a problem where i was setting two different cookies for "
www.myapp.com" and "myapp.com". To fix this, when i set the cookie i
specified the domain to be ".myapp.com". However now when i try to delete
the cookie cookies.delete :myapp_cookie, it wont delete.
Why is that?
Here is my code:
when logging in -
...
cookies[:myapp_cookie] = {:value
2006 Apr 28
3
persistent cookies
hello,
I am trying to implement a "remember be" box for logins, however I cant
seem to get it to work. I have tried the following 2 methods but neither
seem to work. When i check the expiry time in firefox it always says "end
of session".
What is the proper way to handle this so the session cookie "_session_id"
doesnt expire for a year?
I tried
2006 Mar 31
4
Date magic?
Hi.
When I read Dave and Davids excellent book "Agile Web Development with
Rails" the first time, I was particularly impressed with the following
statement:
1.day.from_now
It was used in a test class to set the date of tomorrow dynamically. Since
it was enclosed in in ERb tags, I assumed this was a normal ruby statement,
but when I tried it in my irb, i get the following error:
2006 Feb 24
1
RailsCron: Trigger one time
Hi Kyle,
Thanks for your help so far. Now that I have it up and running, I''ve some
behavior questions.
I want to trigger an event just one time at a future time. I''m using some of
your sample code to try this, but the behavior of some combinations of start,
every, and finish behave in some unpredictable ways.
3 class RailsMaintainer
4 include ActsAsBackground
2007 Oct 04
1
Cookies in RSpec
So how do you work with cookies properly in rspec now? I noticed in
the docs that it mentions session, assigns, and flash, but nothing of
cookie. I''m using edge rails so I''m concerned about changes to the
cookie mechanisms. I need to assign values into the cookie (a
remember token for restful authentication) so that I can have it log
in by cookie. here is my spec
2006 Feb 23
1
RailsCron: ''every'' in background
Got another question. It''s unclear to me what "every" means in the background
function and how it relates to the RailsCron.create "every":
>From README:
RailsCron.create(
:command => "Object.do_something()",
:start => 2.minutes.from_now,
:every => 12.hours, # default: 1.day
:finish =>
2007 Aug 04
5
reusable specs - almost there
I have a lot of controllers with virtually identical functionality for most
actions. I''ve been using shared behaviours to DRY things up a bit, but I
still have to create separate behaviours for each context before I can use
the shared behaviours
what I have now is a generic file which contains all the behaviours and
examples common to all the controllers, and that file gets loaded from
2007 Aug 22
2
stubbing network calls
I have a couple of methods which make networks calls. Where''s the best place
to stub them so they are stubbed for every description automatically? I
tried in spec_helper.rb but they are no longer stubbed when a spec runs.
at the moment, I''m checking for the test environment in the methods
themselves, and returning a dummy value, but I''m sure there''s a better
2007 Feb 18
3
[0.8.0-RC1] problem with drbspec
I''m getting the following error with version 0.8.0 (I updated the gem and the
rails plugin, and re-ran generate/rspec):
c:\wd\clarks>drbspec spec/models/user_spec.rb
c:/ruby/bin/drbspec:16:in `load'': no such file to load -- drbspec
(LoadError)
from c:/ruby/bin/drbspec:16
the same command works fine under 0.7.5.1. Windows XP, rails 1.2.2 and
rubygems 0.9.1
--
View
2008 Oct 11
1
Re: time_ago_in_words is off by a day
Look at your 1.day.from_now and see if it''s like this:
Sun, 12 Oct 2008 02:45:42 UTC +00:00
If you also have the "UTC +00:00", it means that you timezone is the
GMT (and I think that it isn''t your real timezone). For example, my
timezone is 3 hours after the GMT, so the right timezone would be
something like this:
Sat Oct 11 23:48:41 -0300 2008
At your
2006 Jan 07
3
RailsCron 0.1 plugin
I, like many of you, have been searching for a good way to handle
running long processes in Rails. So I rolled my own solution. I
really want feedback! (I''ve tested this on very simple hello world
examples, so don''t use it on anything production yet) .
Grab the plugin:
http://opensvn.csie.org/rails_cron
Here''s the README:
OVERVIEW
========
RailsCron is a way to
2006 Mar 07
0
Re: Hash in a Cookie?
Actually, the first case here doesn''t work at all. I get
cookies[:cities] = [] # a blank array?
So, it looks like the cookies methods don''t allow Hashes...
On 3/7/06, Josh on Rails <rails@thewehners.net> wrote:
>
> In the second case (cities), this DOES work:
>
> cookies[:cities] = @params[:cities]
>
> BUT, creates a this-session-only cookie. Trying