similar to: Can't access session from helper?!

Displaying 20 results from an estimated 70000 matches similar to: "Can't access session from helper?!"

2007 Dec 21
3
Access url_for from rake task
How do I access ActionController:Base url_for method from a Rake task. I tried to access ActionController from irb but it doesn''t work? Check out the pasite http://pastie.caboo.se/131266 -- Anil http://anilwadghule.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2009 Jan 06
1
How to access text helper and url helper methods in model
Hi, I want to access TextHelper and UrlHelper methods in my model so how i am able to access it ? I was included following helper in my model but still it is not working? also for accessing these helper method w need to give external reference? E.g. class Xyz include ActionView::Helpers::TextHelper include ActionView::Helpers::UrlHelper Also
2009 Jun 11
4
Using view helpers and route helpers in a model
Hi there, I am trying to get something working and its driving me crazy. I have been looking around for solutions to getting view helpers working in models and for the most part I find this solution. Add the following in the model you want to use them in include ActionView::Helpers::UrlHelper include ActionController::UrlWriter However, when I try something like
2008 Mar 14
3
ActionController <-> ActiveView code access ambiguity
Hi All! This is not a problem in general but i''ve just missed the point. If my application has a global state, which i have to use both throughout ActionController and ActiveView, then, where to place that state? E.g. if I do this: class ApplicationController < ActionController::Base protected def authenticated? !user.nil? end end then I can''t use that from any
2008 Jan 03
1
help - updated from 1.2.5 to 1.2.6 and getting undefined method 'session=' for ActionController::base
i start the server but it exits right away, I ran the rake to update and changed the version string in config.rb. Any thoughts on this matter would be appreciated. i imagine that it has something to do with the session, but i am not able to figure it out. my config/config.rb has the following config.action_controller.session = { :session_key => ''c3_rails_session'',
2006 Nov 16
2
Stubbing helpers
Hi, Is it possible to stub out a helper for development? I''ve got a (view) helper that renders a partial and runs all kind of javascript. But for dev purposes I''d like it to return some hardcoded html. I''m not having any success stubbing the helper out. Something like... test/mocks/development/helper_stub.rb require ''application_helper'' class
2006 Jul 05
2
How do I access the session in a rails plugin?
I''m trying to access the session in a rails plugin, so as to set it as below. 1. module Juggernaut 2. 3. def self.set_channels(chan) 4. session[:juggernaut_channels] = chan 5. end 6. end 7. 8. module ActionController 9. class Base 10. include Juggernaut 11. end 12. end At the moment I get: undefined local variable or method `session'' for
2008 Dec 02
4
Using Cucumber with latest Webrat
I added cucumber to my rails project using the following commands: git submodule add git://github.com/aslakhellesoy/cucumber.git \ vendor/plugins/cucumber ruby script/generate cucumber git submodule add git://github.com/brynary/webrat.git \ vendor/plugins/webrat git submodule add git://github.com/dchelimsky/rspec.git \ vendor/plugins/rspec git submodule add
2008 Aug 28
1
rspec story - access session
Very simple, but not googlable: how do I access ''session'' in my story? In rspec controller specs I could just say session[:user] for example, but this doesn''t work here. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2007 Apr 16
4
Web Flow and the session method in ActionController
Hi there, I''m writing a port of Spring Webflow to Ruby on rails and I''ve encountered quite a lot of difficulty finding how to override the session[] method which is accessed via any ActionController. I have my pseudo-code ready to implement, but I can''t find the method declaration to copy it''s signature. Also, if anyone wants to collaborate on this particular
2008 Jun 19
5
How do you create one session cookie for multiple subdomains
I am using the restful authentication plugin and am always prompted to login if a different subdomain is accessed. I have found a couple rails "solutions", but none of them seem to work: # development.rb 1. ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_key] = ".localhost" 2. ActionController::Base.session_options[:key] = ".localhost" Does anyone
2006 Mar 03
1
number_to_currency() helper == non DRY == could be improved
Hi all, Apologies in advance if I got this one wrong, I''m still just a newbie ;-) Going through the Apple ADC RoR tutorial it suddenly occurred to me that the ''number_to_currency()'' helper method was not DRY streamlined. Scenario:: The "number_to_currency()" methods options hash works great when I need to dynamically display different currencies when I
2009 Jun 18
1
undefined method `text_field_with_auto_complete'
Dear all: I got the error in my rails 2.2.2 project on ma os x leopard. i did as follow: script/plugin install auto_complete but when i start the server and try to approach the page which used the auto_complete, it can''t find the helper method as the error told: "undefined method `text_field_with_auto_complete'' ", than i try this in script/console helper.methods i
2006 Feb 11
7
Menu Helper
Hi all, I''m trying to add a common menu to all pages in my application. It is just a set of links I want to display. I''m having trouble deciding where to put the code. Below is what I''ve tried to get out of the "Four Days on Rails" tutorial but no luck. Any help would be appreciated. Am I on the right track? Thanks, Sam
2008 Jan 16
4
ActionController::InvalidAuthenticityToken in LoginController
Hi, I''m having a problem trying to get a login controller working. When I try and post to my login controller I get the following error: ActionController::InvalidAuthenticityToken in LoginController#login login_controller: class LoginController < ApplicationController def login case request.method when :post if @session[''user''] =
2009 Aug 28
4
InvalidAuthenticityToken
Hi guys What does the below line says ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): -e:2:in `load'' -e:2 Please guide me -- Karthik.k Mobile - +91-9894991640
2008 Nov 05
3
Problems w/ before_filter getting ignored
Hello, I''m setting up an authentication module that will be called from application.rb. I want to save a rrequest.request_uri into a session to be used as a place holder that will take users back to the page they were on before they logged in. I''m trying to call the store_location method for all methods EXCEPT login by putting login in an except before filter. For some
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
2009 Feb 19
1
Switching to ActiveRecord Session Store
I''m having a problem switching from cookie sessions (the default) to active record sessions. I''ve created the sessions table via the rake task, uncommented the line config.action_controller.session_store = :active_record_store in my environment.rb file, cleared out my browsers cookies, restarted the server (natch), but still the it''s using cookie_store instead of
2008 Mar 16
3
undefined method `redirect_to'
Hi all. I''m getting the following error in my app: undefined method `redirect_to'' for ActionController::Base:Class I''m using Windows 2000, Rails 2.0.2 and resource_controller (from James Golick). My controller: class CommentsController < ApplicationController include ResourceController::Controller belongs_to :post, :article, :photo create do