Displaying 17 results from an estimated 17 matches for "activation_code".
2011 Aug 01
6
Query controller using two resources
...----------
users_controller.rb
----------------------------------
def activate
@user = User.find(params[:id])
end
-----------------------------------
Which finds the user. But how can I make the query to find by both the
user id and the activation code?
like select users where users.id = 45 and activation_code = 1jf872
--
Posted via http://www.ruby-forum.com/.
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this...
2007 Jul 18
3
Help. Acts_as_Authenticated plugin stops working for me?
...couple days before, and i managed to
register a uer with it, with no user activation.
but for some strange reason, it stops working for the signup method,
with i go to the signup page, press submit, it shows an error page,
what''s wrong? here''s the error page.
undefined method `activation_code'' for #<User:0x3b6dbd
@errors=#<ActiveRecord::Errors:0x1a1a1c6 @errors={}, @base=#<User:
0x3b6dbd ...>>,
@attributes={"salt"=>"d580c223adee13c8723434e3987a0787ad124e5b",
"updated_at"=>Wed Jul 18 02:47:19 BST 2007,
"remember_token_expir...
2007 May 06
5
Comparing polymorphic property to same object fails
...ment
application. If the user issuing the invitation is the user being
invited (ie the user assigned themselves to a task), I want to
activate the invitation immediately in the model.
The trouble is that this:
if self.assignable == self.created_by
self.activated_at = Time.now
self.activation_code = nil
end
fails to detect equality correctly. I''ve tried ===, eql? etc.
When I look at .__id__ when I know that I set assignable equal to
created_by, the values are different (wildly so; one is like 4 and the
other is a five digit number or something).
I''m guessing Rails ha...
2008 Jun 29
3
Working around/with Restful Authentication
I''m using Restful Authentication, and the code to create a user is
pretty straight forward - there is a before_save action and a
before_create action:
before_save :encrypt_password
before_create :make_activation_code
But for some reason when I try to create a user programmatically in
the controller like this:
User.new(:email => ''user-n8tE+Mx9DRM@public.gmane.org'', :password =>
''123456'', :password_confirmation => ''123456'')
Nothing happens. I get a...
2006 Apr 12
3
acts_as_authenticated trouble
...ith this plugin, and there
really isn''t too much documentation. I have the newest version of
rails,ruby, and acts_as_authenticated installed.
#The setup
I set up the acts_as_authenticated in the following manner.
*created a table called "accounts" in the database. (minus the
activation_code and activated_at fields)
*used the generator to "script/generate authenticated account account"
*followed the instructions in the README to include AuthenticatedSystem
in my application files.
#the problem
The controllers, views, and models all work fine. The user is directed
to ...
2007 Feb 16
4
Auto detect URL for ActionMailer?
...t''s localhost:3000 or my own
website...
example:
class UserNotifier < ActionMailer::Base
def signup_notification(user)
setup_email(user)
@subject += ''Please activate your new account''
@body[:url] =
"http://localhost:3000/account/activate/#{user.activation_code}"
end
I think this has been answered on the forum already, but from the
answers I could find, I still can''t figure it out... I hope my question
is clear...
Thanks!
Dustin
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You receiv...
2008 Feb 07
1
ActiveRecord 'find_or_initialize_by' dynamic finder bug? Ignoring conditions.
...ublic.gmane.org'') LIMIT 1
=> #<User id: 2, login: nil, email: "foo-+RB1Aph5k6s@public.gmane.org", crypted_password:
nil, salt: nil, created_at: "2008-02-07 00:48:48", updated_at:
"2008-02-07 00:48:48", remember_token: nil, remember_token_expires_at:
nil, activation_code: nil, activated_at: nil, state: "passive",
deleted_at: nil, password_reset_at: nil, forgot_password_code: nil,
name: nil, beta_code: nil, beta_approved_at: nil>
Thanks,
Glenn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed t...
2007 Oct 15
6
SQL injection with :order, :limit, :group
I know how to avoid SQL injection attacks when you use :conditions
User.find :first, :conditions => ["login=?", params[:username]]
but how about with :order, :limit or :group?
# uh-oh...spaghetti-oh
User.find :first, :order => "login; delete from users; select * from users"
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2006 Jan 12
0
generating user table with Acts_as_authenticated
...t.column "login", :string, :limit => 40
t.column "email", :string, :limit => 100
t.column "crypted_password", :string, :limit => 40
t.column "salt", :string, :limit => 40
t.column "activation_code", :string, :limit => 40 # only if you want
t.column "activated_at", :datetime # user activation
t.column "created_at", :datetime
t.column "updated_at", :datetime
end
end
-------------- next part -------------...
2007 Oct 24
1
Attachment_fu and observers/emailing
...hen a user creates their profile/user account, I''ve got an observer
that will email the site admin with a copy of the uploaded CV. My
user_observer looks something like:
class UserObserver < ActiveRecord::Observer
def after_create(user)
UserMailer.deliver_signup(user) unless user.activation_code.blank?
UserMailer.deliver_notification(user)
end
end
The problem I''m having is when the deliver_notification method is
called, I get an error reporting:
No such file or directory - /users/0000/3472/alastairmoore.cv.pdf
Now I''m guessing that attachment_fu hasn''t m...
2009 Mar 25
1
I18n + ActionMailer = conflict ?
...CONFIG[''settings''][''name'']} - "
@subject += "#{ t(''.activate_new_account'') }."
@body[:user] = user
@body[:url] =
"http://#{APP_CONFIG[''settings''][''domain'']}/activate/#{user.activation_code}"
@sent_on = Time.now
end
end
=================================
(See the translation in the 2 "@subject" lines)
Does I18n have a problem with ActionMailer or what am I missing?
Thanks a bunch for any hint!
Tom
--
Posted via http://www.ruby-forum.com/.
--~--~---------~...
2010 Oct 11
5
Object lost in memory/trashed?
...02
id: "41"
user_id: "2"
attributes_cache:
created_at: 2010-10-11 00:44:02 Z
--- !ruby/object:User
attributes:
created_at: 2010-05-23 18:31:02
activated_at: 2010-06-08 22:23:19
send_news: "1"
remember_token_expires_at:
updated_at: 2010-09-19 22:36:42
activation_code:
old_email:
id: "2"
saved_once: "1"
email_hash: 672585615_3008d2bf2e8e7f4455d48212f99a9343
remember_token:
short_name: olance
diagrams_count: "16"
display_name: Olivier Lance
attributes_cache: {}
When it''s a Bookmark object, it displays:
--- !...
2006 Jun 18
10
acts_as_enumerated
Hello All,
Any one using acts_as_enumerated? I need help using (I like that it
caches values in memory)
I am working on a dating website and there are lots of options I want to
store as enumerated like
Status; divorce, single,
Sex: male, female
Eye color; blue, brown, green....
and lots more....
But I do not wanna keep them in seperate tables, and wanna keep them all
together.
Anyone has a
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
2007 Aug 30
8
experimental rails story adapter in trunk
For those of you interested in getting a jump on learning about and
using the new Story Runner in a Rails app, I''ve added an experimental
Rails-Story adapter to trunk.
You can see how to use it here:
http://pastie.caboo.se/92320
This is PURELY EXPERIMENTAL, however it actually works and will likely
not change much in the way that it does work.
Happy hacking!
David
2008 Aug 28
12
Rendering User attributes in XML
Let''s say an app has a User, and a User has many friends. Also, let''s
say the app authentication was built on the restful_authentication
plugin, and we have email and password in the Users table. The friends
controller index might look like this;
# GET /users/1/friends
# GET /users/1/friends.xml
def index
@users = @user.friends
respond_to do |format|
format.html
2006 Jan 31
13
Acts_as_authenticated
Hello
I have been trying a number of security/login generators recently. My
favourite so far is the Acts_as_authenticated. I like the fact that it
is only billed as a starting point and doesn''t try to do everything.
I would like to add security roles to it, so that some of my controller
actions can only be used by an admin role. Has anybody implemented this
using