Displaying 11 results from an estimated 11 matches similar to: "LoginSystem : make @session available to models"
2006 Apr 04
26
Models accessing the session...
Can someone tell if there is a reason models shouldn''t access the
session?
Models could easily be made to access the session or some other shared
persistant data store such as a file or a table.
_This is the problem_, a model needs to know certain information eg. the
id of the current user. But the model has no idea about anything outside
of its self, because it can''t access
2010 Mar 31
1
How to assign currently logged in user name to a table field
I have 3 tables
items (columns are: id, name , type)
history(columns are: id, date, username, item_id, user_id)
user(id , username, password)
When a user "ABC" logs in and creates a new item, a history record gets
created with the following after_create filter.
How to set the username field in history table to "ABC".
class Item < ActiveRecord::Base
has_many :histories
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
2016 May 03
2
New UPS Support: Eaton 5S 1000
Oops... changing that to --with-user=nut solved one problem. I have the
driver, upsd and upsmon running now. Thank you!
Now I'm back to another issue, every 2 seconds I get in the logs:
May 3 13:45:23 myhost upsd[2587]: Connected to UPS [eaton]:
usbhid-ups-eaton
It seems happy to do this forever.
On Tue, May 3, 2016 at 8:17 AM, Charles Lepple <clepple at gmail.com> wrote:
> On
2005 Mar 09
10
Confused about extending the login generator ''user''
I''ve been using the login generator ''out of the box'' for simple
authentication, and its been working fine.
Now I want to extend it by simply adding ''type_id'' field which links to
my ''user_types'' table, but I''m hitting:
#<ActionController::SessionRestoreError: Session contained objects where
the class definition
2006 Nov 04
0
filter function with parameter
hey,
i have found your post about filter function with parameters:
Hi!
I want to add a function with a static paramter ("2" in the example) to
a filter, but somehow Rails seems to be looking for another syntax.
before_filter :check_quantity(2), :only => [:show]
doesn''t work. What''s the right way to do this?
Thanks a lot!
---------------------------------
Can
2006 Feb 01
1
LoginGenerator - Firefox Problem -The page isn''t redirecting properly
Hi,
HAs anyone come across this issue in Firefox;
I''ve just installed LoginGenerator and I''m allowing cookies to be set
yet any all to http://apollo:3000/account/login results in the error;
Firefox has detected that the server is redirecting the request for this
address in a way that will never complete.
Any Clues??
Eric.
2006 Jan 09
0
Need help configuring LoginGenerator
I''m new to Rails and I''m trying to get user login working on my app.
I''m running Ruby 1.8.2 on OSX 10.4 with Rails 1.0
I''ve installed the most recent LoginGenerator(1.1.0) and followed the
instructions in README_LOGIN as well as referencing any additional
information at http://wiki.rubyonrails.com/rails/pages/LoginGenerator.
The error message I''m
2006 Feb 07
0
scope problems testing a helper method that calls link_to()
We''ve been having problems writing functional tests for helper methods
that rely on ActionView methods. Here''s a specific example.
In application_helper.rb I''ve got a method called ''party_link()ยจ:
def party_link(party)
link_to party.full_name, { :controller => ''contacts'',
:action =>
2006 May 26
2
Rails app fails to start with LoginGenerator
Hi guys
I was following this: <a
href="http://wiki.rubyonrails.com/rails/pages/LoginGenerator">tutorial</a>
and everything was perfect until I run the script.
I''ve got:
<strong>MissingSourceFile</strong><br />
no such file to load -- user.rb <br />
RAILS_ROOT: script/../config/.. <br />
<pre><code>
2015 Sep 26
1
Fw: 32 bit data
Begin forwarded message:
Date: Sat, 26 Sep 2015 13:46:13 -0700
From: John La Grou <jl at jps.net>
To: Erik de Castro Lopo <erikd at mega-nerd.com>
Subject: 32 bit data
Erik, could you please post this to the FLAC mailing list. I've tried a
couple times, but nothing happens. Tks.
.........................
There are reasons to support 32-bit data. The emerging network standard