Displaying 20 results from an estimated 10000 matches similar to: "Call methods from ApplicationController from a cron job"
2008 Feb 08
0
Challenge! How can I write a test to test the methods in ApplicationController?
Hi all,
I''ve been Googling this one for a while now, and haven''t found a
satisfactory answer. It has been posted here before by someone else,
but it seems to have got forgotten, so here goes - perhaps someone can
think up a way around the problem?
In ApplicationController, I have the following method:
class ApplicationController < ActionController::Base
<snip>
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
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
2007 Aug 15
4
nuby: how spec redirect_to at ApplicationController
Good morning rspec people!
Still rspec nuby: I must do something wrong obviously.
How can I spec about redirect_to at ApplicationController
describe ApplicationController do
it "method login_required should redirect to home path without login" do
pending "I tried to use controller.login_required.should be_redirected
and got NoMethodError with nil object
2007 Dec 01
3
Rails 2 problem with compute_public_path
I''m trying to migrate to Rails 2, but keep getting these errors all
over the place:
ActionView::TemplateError: wrong number of arguments (2 for 3)
On line #61 of users/new.rhtml
58: <% if @captcha_error -%><div class="fieldWithErrors"><
% end -%>
59: <table class="signup"><tr>
60: <td
2007 Oct 03
2
Scroll to anchor from RJS
Is there an way to tell the browser to scroll to a certain anchor from
an RJS template?
I''m doing a page update, adding stuff at the bottom and want to
browser to go there after it''s been added.
Thanks,
Helzer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
2006 Mar 05
1
access methods defined in helper
Hey
How do I access methods that I have defined in helpers?
__________________________________________
Helper id_browser_helper.rb:
module IdBrowserHelper
def table_identities(message)
render_text message
end
end
___________________________________________
Controller id_browser_controller.rb:
class IdBrowserController < ApplicationController
def view_genre()
2007 Aug 14
2
Spec''ing ApplicationController
Folks,
I''d like to spec the behaviors that I''m adding to ApplicationController.
Specifically, I''m adding:
def authenticated?
session[:username] != nil
end
I described ApplicationController, but couldn''t figure out how to call the
authenticated method. I''m probably going about this quite wrongly and would
appreciate any hints?
Thanks,
Scott
--
2006 May 18
3
access to an ApplicationController property from a view
Hi there,
How is it possible to get access to an ApplicationController property
from a view?
Consider this (simplified) situation:
class ApplicationController < ActionController::Base
def folder_id
@folder_id = params[:id]
return @folder_id
end
end
class FolderController < ApplicationController
def show
@folder = Folder.find_by_id(folder_id)
end
end
So far,
2006 Feb 03
4
(BUG in svn/trunk?) - superclass mismatch for any subclass of ApplicationController
I track svn/trunk of Rails using svn:externals
Some change to Rails committed in the last 1-2 days broke my subclass
of ApplicationController
The example, below, works with Rails 1.0, but in today''s svn, it dies
with the following error:
"superclass mismatch for class FooController"
class ApplicationController < ActionController::Base
end
class FooController <
2008 Nov 16
0
ApplicationController not getting called
This seems to have happened when I upgraded from Rails 2.1.1 to 2.1.2
(although I''m not 100% sure but in applicationcontroller doesn''t seem to
be called when I try to access my default controller (I mean the one
that''s mapped in routes.rb like this map.root :controller => "main")
What this means is that all of a sudden I have to duplicate these types
of
2007 Jan 06
0
ApplicationController common view
I created a user login system in ApplicationController. There is a def
called signin. It needs a view file, signin.rhtml
I have a couple of other controllers inheriting from
ApplicationController. Where can I place the view file so it is
viewable across all controllers? I tried the root view folder but that
didn''t work.
Right now, I would have to copy and paste the signin.rhtml file
2009 Aug 10
2
A copy of ApplicationController has been removed from the module tree but is still active!
Yes, more dependencies.rb fun!
As far as I''m able to ascertain, these errors started appearing after
upgrading from Rails 2.3.1 to 2.3.2 and persist in 2.3.3.
They''re highly nonderministic and appear rather sporadically, which
makes it extremely frustrating. Multiple developers on our team have
experienced this problem across varying versions of Ruby/Rails.
They''re
2007 Oct 16
6
Failure trying to test ApplicationController
I''m trying to write some tests for the ApplicationController as shared
tests that can be run in all of my other controller tests, but am getting
a nil.rewrite error. Below is what I have...
describe AccountController do
it_should_behave_like ''Application controller''
end
describe ''Application controller'', :shared => true do
it
2006 Feb 01
2
Uninitialized constant ApplicationController?
Hello list,
I''m trying to start my Rails server after doing a long complex switch
from Postgres to MySQL, and I''m getting the following error:
=> Booting WEBrick...
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in
`const_missing'': uninitialized constant ApplicationController
(NameError)
from
2006 Apr 14
1
Rendering an ApplicationController''s action
Hi !
I''ve pasted Rails Recipe #31: Authentication code, but I wish to use
these methods in several controllers. Then I pasted them in
ApplicationController, using before_filter method in all the other
needed controllers. The problem is that Rails always tries to render a
missing template inside the current controller (
app/views/controllers/admin/article/signin_form.rhtml ) while
2008 Jan 28
0
gettext 1.10: uninitialized constant ApplicationController
When running rake updatepo with gettext 1.10, for several controllers it
gives
Ignored ''app/controllers/sample_controller.rb''. Solve dependencies first.
/Users/sava/code/sht/trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:266:in
`load_missing_constant'': uninitialized constant ApplicationController
Rails is 1.2.5, frozen in
2006 Oct 09
5
Problem setting variables in ApplicationController.
I''m dynamically generating menu options based on the currently logged
in user: current_user.
My menus are setup on the applicatin.rhtml file. The current_user is
defined in the application controller. But, attempting to assign it a
value while in the application controller results in an ''undefined
method'' error.
ApplicationController ....
def current_user
@cu =
2006 Mar 02
1
web serveces problem
Hi,
I''m trying to added layered web services to my application and from some
reason it''s not working for me. i''m working with ruby 1.84, rails 1.0.
here are my files:
1. app/apis/kate_api.rb:
class KateAPI < ActionWebService::API::Base
inflect_names false
api_method :check_version, :expects => [:string], :returns => [:string]
end
2.
2008 Feb 04
3
Hello World: uninitialized constant ApplicationController
Have the Wrox guide, but still having problems getting my hello world to
run (very frustrating! ;-) Installed latest InstantRails package for
Windows (XP). Thank you so much for helping!!
Dirk
After creating the project directories, I created my
\app\controllers\greeting_controller.rb file:
class GreetingController < ApplicationController
def greeting
end
end
Then put in my