tag:blogger.com,1999:blog-2911377234335400421.post1604846062643818850..comments2023-12-26T12:52:50.667-06:00Comments on Rails on Edge: Rails Forum - Restful Authentication(Part 3 of 3)rledge21http://www.blogger.com/profile/07280624261775331061noreply@blogger.comBlogger45125tag:blogger.com,1999:blog-2911377234335400421.post-64503415937282676942012-04-26T20:47:15.939-05:002012-04-26T20:47:15.939-05:00hey great tutorial, using it to get through a soft...hey great tutorial, using it to get through a software engineering project in school. Professor says who know Rails, no hands go up, ok thats what were using. any case, a lot of the code is not be antiquated, any chance of redoing another tutorial with the undated code for the newer version of rails? I completed tutorial 1 today and can give you the code, took forever to figure out the paths but once i got it I can explain to anyone.<br /><br />Daverussian830https://www.blogger.com/profile/08425425112795768440noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-36388660592739706882011-01-27T03:03:01.086-06:002011-01-27T03:03:01.086-06:00Hi, Thanks for tutorial, In the tutorial there is ...Hi, Thanks for tutorial, In the tutorial there is provision of two users only, I am trying to add one more user i.e New role like admin,super user, user but i don't know how to add another role in this could please help me out on htisAnonymoushttps://www.blogger.com/profile/16475623181744479608noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-1080544696746214552010-06-07T01:21:29.142-05:002010-06-07T01:21:29.142-05:00The activation code sent in signup notification em...The activation code sent in signup notification email is different from the one stored with the new user instance in the DB because User.make_activation_code is being called twice by the AASM layer as currently leveraged by restful_authentication.<br /><br />'make_activation_code' has been declared to be fired on a User instance when it moves from state :pending.<br /><br />The first time it is being called due to the manual state change in UserController::create.<br /><br /> /Users/agranov/work/sb/app/models/user.rb:82:in `make_activation_code'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:162:in `call'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:162:in `run_transition_action'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:23:in `entering'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:59:in `perform'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:94:in `block in fire'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:93:in `each'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:93:in `fire'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:201:in `block in event'<br /> /Users/agranov/work/sb/app/controllers/users_controller.rb:33:in `create'<br /><br />It is called a second time as a result of callback processing:<br /><br /> /Users/agranov/work/sb/app/models/user.rb:82:in `make_activation_code'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:162:in `call'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:162:in `run_transition_action'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:23:in `entering'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:140:in `run_initial_state_actions'<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/callbacks.rb:178:in `evaluate_method'<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/callbacks.rb:166:in `call'<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activesupport<br />[snip...]<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/transactions.rb:196:in `block in save_with_transactions'<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/transactions.rb:196:in `save_with_transactions'<br /> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/base.rb:2657:in `update_attribute'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:61:in `perform'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:94:in `block in fire'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:93:in `each'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:93:in `fire'<br /> /Users/agranov/work/sb/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:201:in `block in event'<br /> /Users/agranov/work/sb/app/controllers/users_controller.rb:33:in `create'<br /><br />Rather than reloading the User instance, a quicker fix is simply to only allow initialization of activation_code once, as in:<br /><br /> def make_activation_code<br /> self.deleted_at = nil<br /> self.activation_code ||= self.class.make_token<br /> end<br /><br />Sorry for the massive post. ;-)<br /><br />-sAlex Agranovhttp://morphogenic.netnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-26187923840940699842010-04-05T12:02:15.157-05:002010-04-05T12:02:15.157-05:00hi,
the activation code in the email is a diffren...hi,<br /><br />the activation code in the email is a diffrent one then the one in the database...<br />am i the only one who is having that?<br />thxUnknownhttps://www.blogger.com/profile/14859988960985759201noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-90032218858754330772010-03-16T01:34:24.498-05:002010-03-16T01:34:24.498-05:00Do you have any unit tests for the added methods (...Do you have any unit tests for the added methods (change/reset/forgot_password)?daudihttps://www.blogger.com/profile/17854126538758831978noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-45810049795859587422010-01-03T08:13:50.587-06:002010-01-03T08:13:50.587-06:00Nice tutorial. Thanks.
Email for signup ist sent ...Nice tutorial. Thanks.<br /><br />Email for signup ist sent (can see it in the console).<br />Copying the link to visit into browser does not activate the new user, and console don't show email sent. Do not get message 'Your account has been activated'.<br /><br />Noticed in user.rb following possible duplication:<br /><br /> # Returns true if the user has just been activated.<br /> def recently_activated?<br /> @activated<br /> end<br />....<br /> def recently_activated?<br /> @recent_active<br /> end<br /><br />Would appreciate any hint on that.<br /><br />Thank youtexmexnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-64792144305674217882009-12-04T09:08:08.188-06:002009-12-04T09:08:08.188-06:00In previous comment i describe problem, but soluti...In previous comment i describe problem, but solution was very simple: now application.rb should be renamed to application_controller.rbAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-60699888355136875172009-12-04T07:07:04.097-06:002009-12-04T07:07:04.097-06:00Hi. I've finded a lots of tutorials regarding ...Hi. I've finded a lots of tutorials regarding restful_authentication, but can't receive any result using any of them (<br /><br />Using this i've received error "undefined method `logged_in?' for #ActionView::Base:0xb7204574". I've finded that this problem catch if string "include AuthenticatedSystem" not in application.rb. I have this string in my application.rb. I'm use rails 2.3.5<br /><br />May be anyone else have any ideas how to fix this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-13791011076201164412009-11-21T13:32:10.317-06:002009-11-21T13:32:10.317-06:00Who knows where to download XRumer 5.0 Palladium? ...Who knows where to download XRumer 5.0 Palladium? <br />Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-85981819062550076052009-11-18T09:46:19.081-06:002009-11-18T09:46:19.081-06:00There is a mistake in the Tutorial.
___
Search fo...There is a mistake in the Tutorial.<br />___<br /><br />Search for:<br /><br />#and put this around them<br /><br />and go to:<br />< % end ><br /><br />__<br /><br />Should be < % end % ><br /><br />___<br /><br />The end-tag was wrong!!!<br /><br />__<br /><br />Nice tutorial!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-3776001723379632372009-11-04T06:44:22.030-06:002009-11-04T06:44:22.030-06:00I too had trouble with the activation code being d...I too had trouble with the activation code being different in the database and in the activation email. The fix suggested by Anonymous on May 15, 2009 worked.<br /><br />Thanks<br /><br />class UserObserver < ActiveRecord::Observer<br />def after_create(user)<br />user.reload<br />UserMailer.deliver_signup_notification(user)<br />end<br />def after_save(user)<br />user.reload<br />UserMailer.deliver_activation(user) if user.recently_activated?<br />end<br />endAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-91686800136031872972009-07-20T06:50:30.255-05:002009-07-20T06:50:30.255-05:00wonderful tutorial!!!!
I have installed postfix......wonderful tutorial!!!!<br />I have installed postfix... than also i m not able to send mail... It gives me message like ur mail has been sent bt i m not able to receive in my mail account.... Plz help me out of this...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-58285952084884364242009-06-29T11:54:30.376-05:002009-06-29T11:54:30.376-05:00Help!! I'm a newbie, I did everything in this ...Help!! I'm a newbie, I did everything in this tutorial,<br />It worked until I don't know if activation works.. how to test it?<br />how to see it thru sql queries?<br /><br />also, I couldn't login or logout. Is there any logout optionn?<br /><br />thank youMr. WHohttps://www.blogger.com/profile/15308555691039865157noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-67579857588476681402009-05-15T15:32:00.000-05:002009-05-15T15:32:00.000-05:00Pay attention, may be this is not an issue for eve...Pay attention, may be this is not an issue for everybody, but if you should have problems, that the sent activation_code does match with that in the database stored, reload your user object before sending its data through email something like:<br /><br /><br /> class UserObserver < ActiveRecord::Observer<br /> def after_create(user)<br /> user.reload<br /> UserMailer.deliver_signup_notification(user)<br /> end<br /> def after_save(user)<br /> user.reload<br /> UserMailer.deliver_activation(user) if user.recently_activated?<br /> end<br /> end<br /> <br /><br />http://github.com/technoweenie/restful-authentication/tree/masterAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-65895709313765222952009-05-02T01:16:00.000-05:002009-05-02T01:16:00.000-05:00Thankyou for the tutorial.It gave a good start.I w...Thankyou for the tutorial.It gave a good start.I would appreciate for your good work.knmnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-79438428156607233772009-04-19T08:15:00.000-05:002009-04-19T08:15:00.000-05:00Hi..I've been following your tutorial closely and...Hi..I've been following your tutorial closely and have made just one change: removed the login field and added email and password validation. Everything works fine until I copy and paste the activation link from the console: <br /><br />We couldn't find a user with that activation code -- check your email? Or maybe you've already activated -- try signing in.<br /><br />I don't know whats going on since I'm pretty sure I cleared out all the login related code. Your thoughts on this will be greatly appreciated. <br /><br />Wonder if we could communicate on the Rails channel on freenode..will be much more efficient. I'm 'bobsaccamano' on Freenode. Thanks.Sandip Gangakhedkarhttps://www.blogger.com/profile/04027527993391765352noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-20934415699361412392009-04-13T22:30:00.000-05:002009-04-13T22:30:00.000-05:00Hasinur,
If you downloaded the latest technoweeni...Hasinur,<br /><br />If you downloaded the latest technoweenie RESTFUL Authentication there is a README.textile that contains a link to the plugin you need. <br /><br />I'm having a problem with the create method in my user controller. I keep getting the following error.<br /><br />NoMethodError in UsersController#create<br />undefined method `name' for #User<br /><br />I'm on 2.3.2. fyi. thanks!mkoppel2040https://www.blogger.com/profile/14558394936360928724noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-6483440673118194512009-03-18T08:23:00.000-05:002009-03-18T08:23:00.000-05:00Really good post. Thanks for this great posts.But ...Really good post. Thanks for this great posts.<BR/>But I am getting the following error:<BR/><BR/>undefined method `acts_as_state_machine' for #Class:0x46edaf8Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-12230189792118546412009-01-30T00:58:00.000-06:002009-01-30T00:58:00.000-06:00Fantastic tutorial. Learned a tremendous amount ab...Fantastic tutorial. Learned a tremendous amount about auth and keeping state.Chris Dotenhttps://www.blogger.com/profile/14041384573028564446noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-38676896662879411902009-01-09T03:08:00.000-06:002009-01-09T03:08:00.000-06:00thank you for great tutorial i works great on my l...thank you for great tutorial i works great on my local machine..<BR/>I have a very simple question since i'm just a newbie on RoR.If i'm ready to deploy my project.What do i need to change on your code since the tutorial design for development.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-28187632868409885272009-01-06T22:09:00.000-06:002009-01-06T22:09:00.000-06:00@josh: try installing Postfix...everything should ...@josh: try installing Postfix...everything should send after that.<BR/>Until you have something setup to actually send the emails, the only place you can read them is in the console.rledge21https://www.blogger.com/profile/07280624261775331061noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-50736101118825652942009-01-05T22:46:00.000-06:002009-01-05T22:46:00.000-06:00i cant seem to get email working im not sure the p...i cant seem to get email working im not sure the problem but im not receiving any emails. could anyone help with this issue?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-49190183177417539142008-12-10T23:49:00.000-06:002008-12-10T23:49:00.000-06:00On this line:#TO THIS map.resources :users, :me...On this line:<BR/><BR/>#TO THIS<BR/> map.resources :users, :member => { :suspend => :put,<BR/> :unsuspend => :put,<BR/> :purge => :delete }<BR/><BR/>It uses "member" - I have a model named "member" already - is that going to mess it up? What is that member for?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-47451178337640676272008-10-01T21:40:00.000-05:002008-10-01T21:40:00.000-05:00In the latest authenticatedsystem, user_logged_in?...In the latest authenticatedsystem, user_logged_in? was replaced with logged_in? . Fix the application.html.erb code to reflect this.Unknownhttps://www.blogger.com/profile/11956045839813596901noreply@blogger.comtag:blogger.com,1999:blog-2911377234335400421.post-2624267949668614782008-09-06T23:02:00.000-05:002008-09-06T23:02:00.000-05:00hi, gregI fined the same problem of your's. i solv...hi, greg<BR/><BR/>I fined the same problem of your's. i solved with a if check:<BR/>if params[:id].blank?<BR/> redirect_back_or_default('/')<BR/>......<BR/>the everything is ok.Anonymousnoreply@blogger.com