similar to: Cannot use "Application" as a model?

Displaying 20 results from an estimated 6000 matches similar to: "Cannot use "Application" as a model?"

2006 Apr 27
5
ERb on he command line re: Ruby For Rails book
Hi, I am working thru the Ruby for rails book. On page 30 David Black talks about running erb from the command line i.e. $ erb erbdemo.rb just as you would a normal ruby prog ($ ruby erbdemo.rb) but when I try to do this I get command not found. How do I make this work? I am running Linux (Ubuntu Breezy) Regards, Paul
2006 Mar 22
3
stack level too deep error : Pulling my hairs out
Hello, I''ve changed something in my test application and since I can''t find the cause of the "stack level too deep" raising on every request. I''ve removed almost every part of code and the error still occurs, eg with this url : www.myhost.com/main/index routes.rb (nothing else in this file) map.connect '':controller/:action/:id''
2008 Feb 22
7
Testing misc methods in ApplicationController
I''m already successfully testing before_filters in application_controller courtesy of this blog post: http://www.movesonrails.com/articles/2008/01/23/spec-ing-your-application-controller However, i can;''t work out how to test the sort of method that is added to application_controller so that all controllers can use it. It must be something simple that i''m doing
2009 Oct 18
4
NoMethodError in User sessionsController#new
I''m setting up authentication with Authlogic and I get this error. I''ve done some searching but with no success. I tried setting the current_user method in Application_controller to protected and not private, on the recommendation in Stack Overflow. Error in browser----------------- NoMethodError in User sessionsController#new undefined method `require_no_user'' for
2008 Mar 28
10
Inheriting from AdminController intstead from ApplicationController
Hi I would like to do the following: I have created an admin namespace and the required folders app/admin views/admin etc. And then I wanted all controllers under app/admin to inherit from a controller named AdminController which resists under app/admin/admin.rb instead of inhereting from ApplicationController, so I could better separate between admin and public section. The AdminController
2010 Jul 05
1
[PATCH] gettext initiation problem Thanks to Thibault Deloffre <tdeloffre@linagora.com>
From: root <root at ovirt.admin.virt.par.lng> Signed-off-by: root <root at ovirt.admin.virt.par.lng> --- src/app/controllers/application_controller.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index 4c4666e..c7f8431 100644 ---
2010 Jul 27
4
Ruby on Rails 3 RC and files in "lib" directory
In Rails 3b4 my ruby files in the lib directory of my application were automaticaly loaded/required. In Rails 3rc1, there are not anymore. Is this normal? Where is the commit that changed this? What is the best prefered way to load the files in "lib"? Thanks for your answers. Nicolas. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed
2011 Jun 09
8
Fail to call
Hi, I''m trying create a user system for a future project but I have a problem when I want give to my users the "Welcome". This is my code: #application_controller class ApplicationController < ActionController::Base protect_from_forgery helper_method :current_user private def current_user_session return @current_user_session if defined?(@current_user_session)
2010 Mar 31
1
[PATCH] Upgrading the server to work with Rails 2.3.4.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- src/app/controllers/application_controller.rb | 2 +- src/config/environment.rb | 2 +- src/config/initializers/new_rails_defaults.rb | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
2007 Nov 20
3
Plugin: can't call before_filter in ApplicationController
Hi all I want to outsource an extension for ApplicationController, that I had in application.rb so far, into a plugin. I have created this plugin, and in init.rb I load require File.dirname(__FILE__) + ''/lib/application_controller'' In lib/application_controller.rb I have the following code: class ApplicationController before_filter :prepare_user ... end This worked
2006 Jun 07
6
Links on the left hand side - are components necessary?
Hello, Maybe this is super-trivial... I need to have a list of links on the left hand side of my application, for *every* single page. So, I''ve created a layout called "main" (main.rhtml) under view/layouts, and included >layout "main"< in pretty all of my controllers. main.rhtml has, amongst all the other HTML stuff: <%= render_component
2012 May 23
8
Engine's Application Controller
Hi, I''ve been using rails 3 engines and (at least in my experience) the engine''s application controller is overidden by the app''s application controller. Wouldn''t it be better if the app would just load on top of the engine? I mean that if an engine''s application controller has methods or anything else that does not collide with the stuff defined
2008 Dec 16
20
step definitons to check login
I am working with the authlogic gem and trying to create a simple login test from cucumber features. The feature statement is: Given the user is not logged in The step definition for this is confounding me. In the application_controller the authlogic tutorial recommends the following: private def require_user unless current_user store_location flash[:notice] =
2012 May 01
1
uninitialized constant LoginController in Ruby
This is my environment.rb # Load the rails application require File.expand_path(''../application'', __FILE__) # Initialize the rails application Qstack::Application.initialize! require ''koala'' This is my application_controller.rb class ApplicationController < ActionController::Base # protect_from_forgery before_filter :parse_facebook_cookies def
2010 Jul 02
6
making something available application wide
I''d like to display a banner on every page. Ultimately I''ll be tweaking which banner is displayed via different controllers but initially I''d just like to set a single banner application wide and display it in my "_header", a partial I include in all layouts. I''ve got a BannerAdvert model, simple. If I''m in my welcome controller index action
2005 Dec 22
11
rforum engine
Here''s a question for those well-versed in rforum or engines -- or both, ideally :) I''ve spent some time today turning RForum into an engine, using rails 1.0, engines trunk, and rforum 0.1 (as rforum trunk didn''t appear to work out of the box). My rforum engine works, but only when I do two things that I found by trial and error: 1) All rforum controllers subclass
2009 Jun 05
6
rails 2.3.2
Hi all, I am using rails v.2.3.2 and if I put following line to my ApplicationController: include LoginSystem and I moved my login_system.rb to lib folder: module LoginSystem protected def is_logged_in? @logged_in_user = User.find(session[:user]) if session[:user] end def logged_in_user return @logged_in_user if is_logged_in? end def logged_in_user=(user) if
2010 Jul 02
17
Doesn't work erb engine
I''m new in RoR:) I have controller and view (/app/controllers/greeting_controller.rb and /app/views/greeting/index.rhtml /.erb/.html.erb - doesn''t match). greeting_controller.rb source: class GreetingController < ApplicationController def index @message = "Hello world!" end end index.rhtml source: <html>
2006 Mar 02
8
User Authentication
I''m trying to create a simple authentication system but am failing miserably. I''m (sort of) following the "Logging In" chapter of the Agile book. Ideally, any access to http://example.com/publish (and any of its subdirectories) should redirect to http:/example.com/publish/login when there is no valid session user_id. Code so far:
2006 Jul 28
2
change url based on account name
Hi, Is this possible Can I specify a url ie http://localhost/AccountName/:contorller/:action/:id Where AccountName is should be a userName, which will lookup a siteId in the database? Whats the best way of going about this, is there somthing in the routes.rb file I can change to get the account name into a variable? Thanks for your help jon -- Posted via http://www.ruby-forum.com/.