similar to: Fixture question...

Displaying 20 results from an estimated 3000 matches similar to: "Fixture question..."

2005 Dec 29
6
How do I open and read/write to a file?
I need to process some text files quickly. I''ve not been able to find the answer in the archive. The Ruby Standard Library site times out. Can someone tell me where to find info on how to: 1. Get a list of filenames in a directory. 2. How to open a file. 3. How to read it a line at a time. -- Thanks in advance for the help, -Larry "Work, work, work...there is no satisfactory
2006 Jan 16
4
Question about self and private
Hi! There''s something I don''t understand yet about static/private methods. I hope someone can explain... E.g.: class SayHello def hello(who) puts "Hello, " + who + "!" end def self.say(words) puts words end end hello = SayHello.new hello.hello "World" : Hello World! hello.say "hi" : Error SayHello.say
2006 Feb 08
10
Sharing sessions between subdomains?
Hello, I know how to share sessions between subdomains in PHP. Can anyone please guide me as to how I can share sessions using Ruby? Where can I set the value of domain for which the cookie is set? I would like for a user to login on the home page and then go to blog.home.com and not have to login again. Any guidance/pointers are appreciated. Thanks''
2006 Mar 27
5
Accessing Session Object from a model
i realise that this goes against the basic idea of the MVC architecture, but i''ve found myself in a situation where i need to get information about the current user in a model & i''m not sure how to do it. Basically, we have a product where each customer has their own profile with data stored in a separate database. There are some tables in a common
2006 Oct 01
7
Log rotation
Hi mongrel-herders, I''m just wondering what fellow railsers use to rotate their logs in an orderly fashion? I''d like to do something lightweight, i.e. (1) rename the logfile (2, optional) create a new empty logfile and (3) send a signal to each mongrel in the cluster and have them understand it''s time to reopen their log file handles. This is what I do with apache and
2006 Feb 19
3
accounts and subdomains
With reference to a previous post:http://www.ruby-forum.com/topic/55201#new I would like my app to function as follows: A new user signs up for my application, his username is "andy". When andy now logs in to the application the url is redirected to : http://andy.myapplication.com Questions: Is this possible to develop on a windows box with webrick? Do I need anything special like
2005 Oct 14
10
Active Record: Prepared Statements?
Hello all, my first project is on it''s way, and I am loving it! But, and that''s a big BUT: Active Record does not use prepared statements! How is that? Everybody is bragging about performance and the most obvious tuning measure is missing. Ok, I don''t know, if MySQL can even do them as I am using Postgres, but still. I started looking at the code and it is not
2005 May 03
2
How to put a form for one controller in another controlers view
Hello, If anyone could help me out with this problem I''d appreciate it... I''m making a database of event bookings, I have an events table and a clients table. I''d like to include a form to create a new client in the form for creating a new event. This would update the parent form with the new client_id using AJAX methods (see previous e-mail) so you''d
2006 May 21
2
Reaper and symbolic links
Hello, I''m trying to restart my application fastcgi processes using reaper. But I get the following error: $sudo -u www ./script/process/reaper Couldn''t find any process matching: /var/www/example/200605200000/public/dispatch.fcgi The problem is that it should not look for 20060520000 but for current which is a symbolic link pointing to 200605200000. I did the
2006 Oct 04
2
Capistrano fails to restart Memcached service
Hi. I am using Capistrano for my webapp and after deploy I need to restart memcached service. I am trying to do it with sudo "/etc/init.d/memcached restart" But it does not do it, even if memcached service existed - after deployment memcached service is off. I did some researching and added run "sleep 40" right after sudo command and found that service process existed
2005 May 06
7
Rails hosting per user
I''m trying to set up shared rails websites, so every user has its own public_html for rails scripts. I''m not really satisfied with the fastcgi approach (cgi scripts can sometimes be nasty security problems) so I''d like to try the another approach. (If someone knows a good tutorial on installing rails on FreeBSD including the fastcgi configuration that would be nice).
2005 Apr 23
7
Validation question
Hi all, Is there a way to invoke validations at times other than save, create and update? I know that I can do this by writing my own validation checks using errors.add_[blah], but I''d like to leverage the existing validation code. What I have is two sets of fields in a record, set A and set B. Both sets must be validated on record create. However, the trouble is that after
2005 May 17
5
Strings, Variables and GetText
Hi, I''m starting to use GetText and have this code: render_text %(<script language="JavaScript" type="text/javascript"> parent.mainframe.onUpdateNew("Gallery <b>#{@media.name}</b> was successfully created.", "#{@media.name}","#{String(@media.id)}","#{@media.media_type}"); </script>) I need to convert
2007 Oct 02
23
Mongrel using way more memory on production than staging. Any ideas why?
I''ve been trying to track down the culprit of erratic behaviour and crashes on my production server (which is split into a number of Xen instances), so set up a staging server so that I could really try to get to the bottom of it. The staging server (also split with Xen) is set up pretty much identically as far as the mongrel_cluster server is concerned (the production box has two
2006 Feb 08
1
testing with loginengine and userengine
Hi all, My unit tests and functional tests are failing because my tests aren''t authenticated. I''m using using user engine and login engine. How can I fake authentication to make my tests work properly. Thanks, Jason Edgecombe
2006 Aug 22
1
Why the caches_page can not work?
Hi,I want the page to be cached and be accessed by all users.And in my controller: class MyController < ApplicationController caches_page :show def show render :layout => false end end When I use link_to_remote to use My/show to update some div, i can not see the template has been cached. However,If I use <%= render_component :controller => ''My'',
2006 Sep 25
8
mongrel.pid disappearing
Hi to everybody, This my first post on the list. I''m a newby of mongrel & rails, I''ve deployed my first project and everything seems to work fine, the only problem I have is the following: After about 1 or 2 days of the mongrel_rails daemon running the mongrel.pid in the log directory disappears, the mongrel process is still there running but doesn''t respond
2006 Aug 31
2
How to set RAILS_ENV for different directories (fcgid)
Hello! I want to use the same application in two environments (production and development) on the same server (apache2 with fcgid) in different (aliased) directories. Is there a way to specify RAILS_ENV inside my <Directory> directives? I have the line DefaultInitEnv RAILS_ENV production in my httpd.conf but I want one of the directories to be development. Setting the ENV var directly in
2007 Jun 19
2
Session Problem with Ajax Call
Hai,, I am totally new to Ajax. I am trying to use ajax in my project. Its working fine, I am getting problem while session time expires. If session expires means i am redirecting to login page.Onclick i am calling on ajax function. It will goto controller and it will check the session if session expires then it has to goto login page. On ajax call i am updating the div. If session
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
I still want to get this into Rails for all connection adaptors, but for now I''ve hacked my own addition on for just PostgreSQL. The following code extends every Column object returned by MyModel.columns to support a new #required? method, which indicates if the column may or may not be null. The following is a huge hack - suggestions on a cleaner way to add this functionality