search for: mytestcontrol

Displaying 10 results from an estimated 10 matches for "mytestcontrol".

2005 Jun 23
6
Problems with Hello World
...RubyOnRails in my Fedora Core 4 system. I''ve created an empty web application with: rails cookbook then a controller ruby script/generate controller MyTest And a file named my_test_controller.rb was created at cookbook/app/controller directory. I ''ve written a new method for MyTestController class like: def index render_text "Hello World" end Finally I''ve started the server: ruby script/server Well If I go to http://127.0.0.1:3000 I can see the initial page from ruby server. That''s okay. If I go to http://127.0.0.1:3000/MyTest or http://127.0.0.1...
2006 Mar 28
6
blank page output
...ich comes with Ruby 1.84-1. I installed rubyonrails, and I''m doing the a sample program found on http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=2 I ran ruby script/generate controller MyTest. I edited the file my_test_controller.rb. Here''s the code I entered class MyTestController < ApplicationController def index render_text "Hello World, my first line of Ruby" end end I save the file. I then ran the browser with the following url http://127.0.0.1:3000/My_Test/ I get a blank page, no output. if I do http://127.0.0.1:3000/garbage/ I still get a bl...
2006 Apr 03
9
Problem with Windows not finding methods
I am running (testing) a noob-tube for myself as follows: Windows XP SP2 lighty ruby 1.8.x rails 1.1 scgi I have everything working fairly well, but with one minor exception: the actions that I have defined as follows are not found. class MytestController < ApplicationController def index render_text "Hello Nurse!" end def dilbert render_text "Dilbert rocks!" end end If I browse to 127.0.0.1 I get the default page, but if I then go to 127.0.0.1/mytest/index or ../mytest/dilbert, then I get the following r...
2005 Dec 15
11
CGI Module in Rails
I''m trying to use the CGI module to generate the html in a view but am having trouble. My controller looks like: class MyTestController < ApplicationController def cgitest require ''cgi'' @cgi=CGI.new("html3") end end My cgitest.rhtml view document simply has: <%= @cgi.out{@cgi.html{@cgi.head{}}} %> Loading MyTest/cgitest, Rails tells me that ''html'' is an invalid or...
2008 Sep 23
1
Help with "No route matches "/MyTest/" with {:method=>:get}"
...r. I was reading a tutorial and based on it, when I type in http://localhost:3000/MyTest/ it should say whatever I have written down on my my_test_controller.rb file. I first ran: ruby script\generate controller MyTest then I edited the my_test_controller.rb file It currently says: ------- class MyTestController < ApplicationController def index render_text "Please Help" end end ------- I removed the index file from the public folder also. Can anyone give me some quick advice for how I can get this to show up? I also have not edited the routes.rb file and I am running on a Mac....
2006 Nov 09
0
Apache configuration
....fcgi to AddHandler fcgid-script .fcgi do NOT change the require line as other guides tell you to do. Hello, World! 1. cd /var/www/rails/cookbook/ 2. ruby script/generate controller mytest 3. vi app/controllers/my_test_controller.rb Change file to read: class MyTestController < ApplicationController def index render_text => "Hello World!" end end 4. /sbin/service httpd start BUT AT LAST IS ACTION CONTROLLER EXCEPTION AND PAGE IS REDIRECTED OTHER SITES. THIS CONFIGURATION DO NOT . IS CONFIGURING APACHE FOR RUBY...
2006 Jan 13
6
rails bug ? metadata lost between page invocation ?
...he SimpleObj model (notice the new method ''extra_attr''): # file app/models/simple_obj class SimpleObj < ActiveRecord::Base def extra_attr "hello" end end Here is the controller # file app/controllers/my_test_controller.rb class MyTestController < ApplicationController def put MyCache.put end def get MyCache.get end end Here is the cache object: # file app/my_cache.rb class MyCache @@saved_obj = nil def self.put @@saved_obj = SimpleObj.new p @@saved_ob...
2006 Aug 04
0
Proxy from Apache to local Lighttpd instance
...sponse.c.111) Response-Header: HTTP/1.1 404 Not Found Transfer-Encoding: chunked Content-Type: text/html Set-Cookie: _session_id=771f1bb2977865b939344efae0430bcc; path=/ Cache-Control: no-cache Date: Fri, 04 Aug 2006 14:23:34 GMT Server: lighttpd/1.4.11 app/controllers/my_test_controller.rb: class MyTestController < ApplicationController def index render_text "Hello ze world" end end What is going wrong here? Any help would be appreciated, if I can''t get this to work my project fails painfully... Bart
2007 Mar 06
59
Memory leaks in my site
Hi all, My environment is ruby-1.8.4, rails 1.2.2, mongrel 1.0.1, linux 2.6. Now, i have a problem on memory leaks with mongrel. My site is running 5 mongrel processes on a 2G RAM machine, the memory of each process grows from about 20M to about 250M, but it never recover to the initial 20M, so i had to restart the mongrel processes once per day. The load is about 1M hits per day. Waiting for
2005 Dec 16
25
I Would Really Like to Try RoR but...
it''s been a nightmare trying to set it up. I keep getting a an Application Error message when I try to navigate to a url which should be taken care of by my newly created controllers. For instance, I wanted to test RoR out so I created a MyTest controller which should allow me to navigate something like: http://localhost/rubytest/MyTest but it does not. I have no problem getting