Displaying 20 results from an estimated 4000 matches similar to: "recording current_user"
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here:
http://railstutorial.org/chapters/sign-in-sign-out#top
At the end of the tutorial, rails is erroring (see below). being new
to Rails and after having checked the tutorial... How do you resolve
this kind of error. It''s saying current_user is not defined, and it is
supposed to be defined with/Sites/sample_app/app/helpers/
2007 Aug 21
2
using restful_authentication current_user inside controller specs
I''m using restful_authentication in my app and I have the before filters in
my application rhtml:
before_filter :login_required
around_filter :set_timezone
around_filter :catch_errors
Currently I have them commented out while rspec''in but I''ll need to add them
in my specs.
def create
@ticket = Ticket.new(params[:ticket])
@ticket.user = current_user
if
2006 Jan 16
16
acts_as_authenticated current_user in a model?
What do I need to do to be able to use an acts_as_authenticated
current_user in a model?
Is there some sort of include or require I can do some where that would
allow this?
**********************************************************
Here is what I am trying to do:
**********************************************************
class Setting < ActiveRecord::Base
before_create :created_by_user #
2010 Sep 16
3
Resyful authenticatio current_user in model
Hi,
I am using Restful authentication for user authentication.
I want the current logged in user object in my model property.rb
Problem is current_user is not working on model.
How can I fix this I need that?
Please help me out.
Thanks,
Mike
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2011 Jun 12
3
Problem with undefined variable current_user
Hi everyone,
I''m working through the tutorial at the following link and attempting to
customise/adapt the lessons for my own slightly different application.
Link:
Ruby on Rails Tutorial: Learn Rails by Example | Ruby on Rails 3
Tutorial book and screencasts | by Michael Hartl
<http://ruby.railstutorial.org/ruby-on-rails-tutorial-book>
I''m currently trying to work
2012 Mar 05
0
Rails 3 - How can you get access to current_user in the IRB console?
I''m doing some design/debugging in IRB and need to login a user and then be
able to gain access to current_user in my efforts (I''m using Devise for
authentication.)
I found a sequence from SO that allows me to successfully login via IRB and
access a page response:
>> ApplicationController.allow_forgery_protection = false
>> app.post(''/sign_in'',
2009 Jan 09
14
undefined local variable or method `current_user' for
Hi All, I am using a Plugin mdarby-restful_acl with
restful_authentication and I am following the procedure form
http://github.com/mdarby/restful_acl/tree/master , but I am getting some
irritating error "undefined local variable or method `current_user'' for", I
know I am missing something but I dont know what?
Can anybody help me regarding this?
Shahroon
2012 Apr 06
0
i can not get current_user while writing test case with Rspec and Capybara
0 down vote favorite
share [g+] share [fb] share [tw]
I have to write test case for my one feature listing page and that
feature index method has code like below
def index
@features = current_user.features
end
Now when i try to write test case for this then it throws error for
''undefined method features for nil class'' because it can not get the
current user
Now what i have
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi,
I just installed Rails 2.0.2
[root@mymachine easyx]# ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
[root@mymachine easyrx]# gem install rails --include-dependencies
Need to update 16 gems from http://gems.rubyforge.org
................
complete
Successfully installed rails-2.0.2
[root@remandev easyrx]#
But I''m getting this error in my restful_authentication
2009 Sep 16
5
piece of code that runs only once
hi, an strange error is happening here
in User model i have the following method:
def falta_votar
Category.find(:all) - votes.collect {|v| v.category}
end
and in the default.html.erb layout i have:
<%= current_user.falta_votar.size %>
but it only works once, when i try to access another page i get an
error message saying that the falta_votar method is nil, then i have
to restart
2008 Dec 06
1
MGE Evolution and programmable outlets configuration
Hi,
I'm a MGE Evolution 650 owner and, after putting in place a basic
configuration for controlling my UPS, I'm going to tune a little bit
better NUT for my needs.
First of all let me describe my little (SOHO) scenario: I have the ISP
modem/switch (providing VoIP too, so it's important to keep it running
as much as possible), a small low power home server and a much hungrier
PC.
2012 Mar 09
2
ActionMailer message delivery content
I have the ability to send email to a user if a certain user has
requested interest in their product. In my email I want to include
certain information that is pulled from users but at the moment I am
getting errors because it states that they are undefined despite these
lines being used elsewhere in my application. I shall copy the email
below and anything between the <% %> is what I wish
2020 Sep 05
9
ups not being started sat reboot
But runs normally if started. On a rpi4 running an uptodate raspbian
buster, how do I set it to auto start at boot time?
Thanks.
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
- Louis D.
2011 Oct 07
1
Dynamic HID driver mappings, Tripplite-hid.c
I think I'm going to have the slightly rejigger the tripplite-hid.c
driver to 'properly' support all of the data I know about it's
outlets.
A given UPS may have 'n' output loads. I could have 5, I could have
10, I won't know until I actually ask the UPS. But in order to use
the hid to nut struct, I'm actually going to have to modify that
struct dynamically, or
2008 May 14
5
RailsConf vs. My MacBook's Battery. ( Power Outlet Availability )
So my Macbook''s battery sucks... and I''m thinking of grabbing a new
one, I''m curious how the availability of power outlets have been at
RailsConfs. For those who have gone before, was it hard to find an
outlet to plug into? Are they mindful of this?
I hope so.
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because
2010 Jul 28
1
paperclip, authlogic and callback issue
I use authlogic for authentication and paperclip for handling user''s
profile picture attachments.
I use the following method to get the current_user
def current_user_session
return @current_user_session if defined?
(@current_user_session)
@current_user_session = UserSession.find
end
def current_user
return @current_user if defined?(@current_user)
2010 Apr 16
4
DEEEEPLY nested
Hello,
i have "a" has many "b", "b" has many "c", and "c" has many "d"
Now... "d" is a user model, and I have a current_user helper method
defined.
If i navigate to an "a" show page, how can I make sure that my
current_user ("d") is part of that "a"? meaning how can i make sure
that
2006 Jun 27
3
Setting MGE powershare attributes
Hi!
We have two MGE Evolution 1100 here, and I want to make use of the
powershare outlets to force a particular boot sequence on the machines
powered by them. However I'm not sure how to set those variables upon
NUT starting, without having to change the init scripts to call
"upsrw".
Is there some place where I can set them, where they can be read
automatically on startup?
One of
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 Aug 16
3
calculate method is gone once I use ''find''?
Could someone please explain why this works:
current_user.accounts.sum(:balance)
But not this:
current_user.accounts.find_all_by_active(true).sum(:balance)
For the latter Rails tells me sum is an undefined method. It seems like
I lose the ActiveRecord methods when I call ''find''?
This (simpler) does not work either:
current_user.accounts.find_all.sum(:balance)
Thanks!
--