similar to: Class Variable Scope

Displaying 20 results from an estimated 10000 matches similar to: "Class Variable Scope"

2006 May 13
1
newbie question - routes.rb on server
Hello, I am new to Ruby but not to programming. I have a domain name and server space with a host who said that ruby on rails should work on the server. All I want to do is make sure that a test ruby application works online so that I can begin development on an app. I am able to get the test program to work locally but not online. In C:/ruby/projects/test/controllers/TestController.rb:
2006 Jun 01
9
access model from controller
Hello, Rather new to RoR, so I''m not sure about the terminology and such :-/ . My question is: how could I know the model which is associated to a controller? For example: - controller class is TestController, which is a subclass of ApplicationController - associated model class is Test How could I write some code in a method of ApplicationController to dermine the current
2006 Jul 22
3
Connection refused - connect(2)
Dear all, Please help me in this regards, I am using models to access LegacySchemas using set_table_name and set_primary_key... [code for model] class CdDetails < ActiveRecord::Base def self.find_data set_table_name ''cd_details'' set_primary_key ''cd_label'' find (:first, :select => "cd_label") end
2006 Jan 19
3
template/variable confusion
Hi there, I''m having some trouble working out where/when I can define template variables. I have a standard.rhtml layout template which is used across the application as the main xhtml wrapper. Inside there is some code like this: <div id="<%= @layout_style %>"> <%= @content_for_layout %> </div> Now content_for_layout always works fine, but
2006 Jun 07
1
What is class TestController < ActionController::Base
What are the different parts of; class TestController < ActionController::Base? I look at the http://api.rubyonrails.org/ and try to understand but I don''t. Could someone give me a hint? I get the part of Test being the "folder", def and all that, but I can''t find an explanation of the basic stuff. -- Posted via http://www.ruby-forum.com/.
2006 Oct 01
9
How to create a very simple form
Hi all, I would like to create a very simple form with RoR similar to this one in ASP.Net: http://quickstarts.asp.net/QuickStartv20/aspnet/samples/ctrlref/standard/TextBox/TextBox1_vb.aspx I my RoR project I want to add a Greeter class like this one: class Greeter def initialize(name = "World") @name = name end def say_hi puts "Hi #{@name}!" end def
2009 Mar 05
8
Can I construct the controller myself in a controller spec?
Hi I am experimenting with Constructor based dependency injection for rails controllers. So I have something like this class LoginSessionsController < ApplicationController def initialize(authenticator = TheRealAuthenticator) @authenticator = authenticator end .... end The plan was to override the authenticator used when testing with something like describe
2006 Sep 25
3
Engine Yard blog
Just received the news from Tom Mornini. Congrats Ezra for the new Engine Yard site and the blog you will be collaborating. Hope to read you there soon. http://www.engineyard.com/ Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060925/3f251fa4/attachment.html
2006 Mar 08
7
Function could determine the caller action ?
Is it possible to determine which action call the function ? In example, func_test in ApplicationController could determine which action from SiteController is calling her ? in class ApplicationController I have def func_test if ( calling from index ) return "1" end if ( calling from contact ) return "2" end end and in class SiteController def
2006 Jul 10
2
''uninitialized constant'' error
Hi All, I am fairly new to Ruby and backgroundRB. I am trying to run a simple example in Windows to get my feet wet with backgroundRB and am running into an ''uninitialized constant'' error when I invoke the controller on my rails app. In ''MyTest'' Controller ------------------- def longrun session[:job_key] = MiddleMan.new_worker(:class =>
2005 Dec 31
7
Application Errors w/ layout & custom view pages
1) I get Rails Application Error when trying to use layout test_controller def list layout "stdlayout" end in the views/test/layouts stdlayout.rhtml <html> <head><title>test</title></head> </body> <h1>Test</h1> <%= content_for_layout %> </body> </html> 2) I get Rails Application Error when trying to use a separate
2006 Sep 12
2
Cache sweeping and render_component (my mistake or Rails bug?)
Hi I''m working on a program which relies on heavy cache sweeper usage. I''ve just bumped onto an odd problem. When using render_component method in layouts or templates with cache sweeping turned on, Rails throws an exception with the following message: NoMethodError in TestController#index You have a nil object when you didn''t expect it! The error occured while
2006 Feb 16
3
Breakpoints completely fail to work
I did as I was told: add "breakpoint" to an action, start script/server, start script/breakpointer, then go to the action in the browser. Absolutely nothing happens, on either side. I''ve tried every variation of starting what when I can think of, I''ve specified ports, I''ve done all I can think of, but never once have I gotten the fabled irb prompt that
2007 Mar 04
4
Rails functional testing and Mocha
I''ve always wanted to be able to do stuff like this in my functional tests c = customers(:customer_1) c.expects(:great_customer_service) post :service_customer, :id => c.id This of course fails because inside the rails action a different instance of customer is used. Some of the time setting your expectation/stubbing on Customer.any_instance works, but it''s not
2006 Jan 10
1
Frames
Well, I know there''s a better way (not using frames) but bear with me while we get rev 1 out the door and then switch. In the meantime I need to redirect from one frame into another and cannot for the life of me figure out a reference to get to another frame: redirect_to :controller => testController'', :action => testProc'' I cannot seem to add :target or
2010 Nov 22
3
can't activate i18n (~> 0.4.1, runtime) for ["mail-2.2.10"
Hi Using RoR 3.0.3 on Mac OS X, and am running into the dependency problems. Please see the error below. I thought bundler was meant to precisely avoid these problems? thanks a lot for your help I tried bundle install / check , deleted old lockfile and regenerate it, but nothing worked. rails generate controller testcontroller index /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:233:in
2007 Feb 15
17
Odd parameter munging with with()
Hi, I have this setup block: setup do session[:login] = ''jhughes'' @user = mock("user") User.stub!(:find).and_return(@user) @params = {:cn => "Bilbo Baggins", :telephoneNumber => "416-277-4418", :mail => "bilbo at baggins.com"} end And then this spec: specify "should update and save the
2006 May 04
6
second assert_tag failling in rails integration test
Hi all, I''m fairly new to rails and ruby, but I''ve come across an interesting glitch and I''m not sure whether I''ve just got something wrong with my assumptions or if it really is an error in the underlying framework... I''ve created a bare-bones set of tests to show you where the problem is. What follows are the steps I went through to reproduce the
2019 Jan 20
2
Still hitting odd problems trying to install R 3.5.2 on Debian amd64 machine
My Emails a week or so back were about installing Rstudio and the R shiny server on Debian. I was using an old Toshiba laptop as a sandbox for that and it would only install i386 (same for Ubuntu). Using the information at https://cran.r-project.org/bin/linux/debian/ I did get to the point where I had R 3.5.2, Rstudio and the server on there (with some help from Dirk that is in the list archives).
2006 Mar 29
0
Bug with skip_before_filter?
There seems to be a bug with skip_before_filter using the :only or :except conditionals. Or am I using them completely wrong? I have this code: The result is that :test_filter is skipped for both index, and index_no_filter. application.rb # Filters added to this controller will be run for all controllers in the application. # Likewise, all the methods added will be available for all