Displaying 20 results from an estimated 2000 matches similar to: "Resyful authenticatio current_user in model"
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 #
2006 Jan 20
11
Userstamp Plugin
I''m pleased to announce a new plugin for Rails: Userstamp. You can read my
blog post at http://www.delynnberry.com/articles/2006/01/20/userstamp-plugin
and/or read all about it at the perminant page
http://www.delynnberry.com/pages/userstamp. Any comments or suggestions for
improvement are much appreciated.
--
DeLynn Berry
delynn@gmail.com
http://www.delynnberry.com
A dump of the Readme
2007 Jun 18
2
weakness of helper?
Hi ,
It comes to me that helper has some weaknesses:
1) It is hard to test . No easy way to write test code for it.
(or Just i didn''t know?)
2) Not easy to reuse it on other controller/view/model.
it looks like to that putting the helper code into a model (a
fully helper model , or a mixed model) is good practice.
However i agree that some html intensive
2010 Jan 12
8
tips on how to write a controller test for models associated with currently logged in user
I have a controller test here:
http://gist.github.com/275616, which works fine when account is an
independent model, however I want:
an account to be a property of user, ( and created and associated when
a user is)
when the user goes to /account/edit it should on edit the account of
the logged in user -
I can make rails do this, but I''m utterly baffled how I should alter
this test to
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
2007 Aug 23
3
recording current_user
Hi,
Another noob here I am afraid! I have a questuin about the current_user
method that comes with AAA.
I have AAA set up and working fine and if i put <%=
self.current_user.login %> into a view it shows the login name as
expected on the page.
What I cant work out is how to record this into the database when the
user completes a form.
My app so far only has two models.
2010 Apr 20
5
Spring Cleaning
Right now in my view, I have a whole HUGE clump of
<% if current_user %> and then <% if current_admin %> and then <% if
current_teacher %> and then all that other stuff in my view.
I have a ginourmous chunk of if and else statements in my views... is
there a way to make it prettier? The if and else''s almost all have the
same functions, expect for some minor changes.
2009 Dec 23
8
Where did this value in a form come from?
Newb here.
I have a form and a value that is being displayed ... and I have no idea
where the value came from.
I have done a
<%= debugger; '''' %>
in the form and, indeed, the debugger stops at the statement.
I have tried to trace through the code to see where the value came from
... and I gave up.
So ... what in Rails initializes the fields of a form?
--
Posted via
2010 Jan 22
11
Finding out where a variable is defined
I''m looking at code in a project. I have no clue what is being passed
into the resource parameter:
def read_authorized?(resource)
if resource.respond_to? :user_read_authorized?
resource.user_read_authorized? current_user
else
true
end
end
Is there any kind of debugging feature I can run to see what gets passed
into resource in this specific
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
2009 Dec 25
18
rescue_from ActionController::RoutingError II
OK ... so I''m not supposed to use it but ...
Why doesn''t rescue_from ActionController::RoutingError work witht he
code from
http://www.rubyplus.org/episodes/20-Extended-RESTful-Authentication-Rails-2-App.html
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
# See ActionController::RequestForgeryProtection for details
2007 Jan 31
1
Just copied my app to another puter, and now...
it doesn''t run : (
no matter where i go in my controller, I am getting this error message:
The Browser View:
-----------------
Status: 500 Internal Server Error Content-Type: text/html
Application error
The Log:
------------------------
Processing Base#index (for 127.0.0.1 at 2007-01-31 06:01:31) [GET]
Session ID: 6a380e82bd3afb39dcb57ecfa143766d
Parameters:
2002 Jul 25
0
HPUX 11.00 & CIFS/9000 Server - Domain authenticatio n problem
can you post your smb.conf
you should set encryption to yes
and put wins,dc server name in password server paratmeter
-----Original Message-----
From: Cheney, Richard [mailto:Richard.Cheney@infores.com]
Sent: Thursday, July 25, 2002 11:32 AM
To: samba@lists.samba.org
Subject: [Samba] HPUX 11.00 & CIFS/9000 Server - Domain authentication
problem
Hi,
I have been using Samba and CIFS/9000
2010 Dec 27
4
Crazy routes
Hello!
I''m using restful_authentication and I would like to have diferent views
for logged users and not logged users. Logged users can edit and create
items, and not logged user could only list items and show its features.
In my routes file I have:
map.namespace :admin do |admin|
map.resources :items, :controller => "admin/items", :path_prefix =>
2010 Jan 25
9
skinny Controllers, fat models with REST?
Hi,
I''m really new to rails, so i programmed some stuff and today i read
some things about skinny Controllers, fat models.
My Controllers are really fat now. So i''m asking myself how can i
shrink my controllers and move the code to the models, especially in
fact of REST e.g. in focus on error codes?
code example:
# POST /tasks
# POST /tasks.xml
def create
@authorized
2008 Oct 13
10
Shibboleth
Can anyone direct me to a really good tutorial on Shibboleth integration
with Rails, or indeed some sample code? I''ve been tearing my hair out
all day on this one.
Thanks
RobL
--~--~---------~--~----~------------~-------~--~----~
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
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
2006 Jul 18
1
usermonitor / user stamping active record
Quick question about userstamping records in a similar way to
timestamping. There is an example of how this might work at:
http://wiki.rubyonrails.org/rails/pages/Howto+Add+created_by+and+updated_by/versions/7
This seems to work fine on my development system. However, I am not
sure how the User.current_user method, which is required, can guarantee
to return the correct user since this is a
2010 Aug 16
8
Executing js.erb file with :format =>'js'
Hi, I''m trying to get my javascript to execute after clicking a link on
my page using :format => "js" here''s my link:
<%= link_to image_tag("/images/icons/user_add.png"),
add_contact_path(:profile_id => profile.id, :url => request.url, :format
=> "js"), :title => "Add person to your contacts"%>
in my controller i have