Hello, I''ve been wrestling with the Salted Hash Login Generator[1] for some time now and keep getting errors like: NoMethodError in User#login Showing /user/login.rhtml where line #2 raised: undefined method `l'' for #<ActionView::Base:0x3af0e80> Extracted source (around line #2): 1: <div title="<%= title_helper %>" class="form"> 2: <%= head_helper %> 3: <div class="form-padding"> 4: <%= start_form_tag_helper %> 5: <table> I guess it''s something very simple I have missed but I''m very new to Ruby on Rails and can''t seem to find out what. Can you point me in the right direction? Or do you know of complete Rails example project that uses the Salted Hash Login Generator? [1]http://wiki.rubyonrails.com/rails/show/SaltedHashLoginGenerator -- Jonas Elfström
OK, some information we need first: 1. Which version of rails 2. Which version of the salted hash login generator 3. Do your unit tests pass? 4. Do your functional tests pass? 5. Can we see the changes you''ve made to: a.) Your environment.rb file b.) Your application controller Then we should be able to see what''s going on... sam On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I''ve been wrestling with the Salted Hash Login Generator[1] for some > time now and keep getting errors like: > NoMethodError in User#login > Showing /user/login.rhtml where line #2 raised: > undefined method `l'' for #<ActionView::Base:0x3af0e80> > > Extracted source (around line #2): > 1: <div title="<%= title_helper %>" class="form"> > 2: <%= head_helper %> > 3: <div class="form-padding"> > 4: <%= start_form_tag_helper %> > 5: <table> > > I guess it''s something very simple I have missed but I''m very new to > Ruby on Rails and can''t seem to find out what. Can you point me in the > right direction? > Or do you know of complete Rails example project that uses the Salted > Hash Login Generator? > > [1]http://wiki.rubyonrails.com/rails/show/SaltedHashLoginGenerator > > -- > Jonas Elfström > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- sam http://www.magpiebrain.com/
Hello Jonas, The "undefined method ''l''" usually refers to the Localization not being required properly. The "head" of my application.rb controller looks like: require ''user_system'' require ''localization'' class ApplicationController < ActionController::Base include UserSystem include Localization You should have something similar. Hope this helps, /B On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I''ve been wrestling with the Salted Hash Login Generator[1] for some > time now and keep getting errors like: > NoMethodError in User#login > Showing /user/login.rhtml where line #2 raised: > undefined method `l'' for #<ActionView::Base:0x3af0e80> > > Extracted source (around line #2): > 1: <div title="<%= title_helper %>" class="form"> > 2: <%= head_helper %> > 3: <div class="form-padding"> > 4: <%= start_form_tag_helper %> > 5: <table> > > I guess it''s something very simple I have missed but I''m very new to > Ruby on Rails and can''t seem to find out what. Can you point me in the > right direction? > Or do you know of complete Rails example project that uses the Salted > Hash Login Generator? > > [1]http://wiki.rubyonrails.com/rails/show/SaltedHashLoginGenerator > > -- > Jonas Elfström > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Bruno Mattarollo <bruno.mattarollo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Currently in: Sydney, Australia
On 5/17/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> OK, some information we need first:SORRY!> 1. Which version of rails0.12.1> 2. Which version of the salted hash login generator1.0.8> 3. Do your unit tests pass?Yes, I am very new to these tests but: ruby test\unit\user_test.rb and ruby test\unit\places_test.rb passes with no errors. places is my own scaffold test.> 4. Do your functional tests pass?No. Same error as already specified: test_auth_bob(UserControllerTest): NoMethodError: undefined method `l'' for #<UserController:0x39fa890> ./test/functional/../../config/..//app/controllers/user_controller.rb:9:in `login''> 5. Can we see the changes you''ve made to: > a.) Your environment.rb fileAdded at the end: require ''environments/user_environment''> b.) Your application controllerIn places_controller.rb (which is a super siple scaffolded controller against a simple table with an id and to varchar fields), it works fine until I add: class PlacesController < ApplicationController before_filter :login_required> Then we should be able to see what''s going on...Thanks in advance! PS. After digging out this information it feels like I should be able to solve this myself but embarrasing enough I am not there yet. DS.> On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello, > > > > I''ve been wrestling with the Salted Hash Login Generator[1] for some > > time now and keep getting errors like: > > NoMethodError in User#login > > Showing /user/login.rhtml where line #2 raised: > > undefined method `l'' for #<ActionView::Base:0x3af0e80> > > > > Extracted source (around line #2): > > 1: <div title="<%= title_helper %>" class="form"> > > 2: <%= head_helper %> > > 3: <div class="form-padding"> > > 4: <%= start_form_tag_helper %> > > 5: <table> > > > > I guess it''s something very simple I have missed but I''m very new to > > Ruby on Rails and can''t seem to find out what. Can you point me in the > > right direction? > > Or do you know of complete Rails example project that uses the Salted > > Hash Login Generator? > > > > [1]http://wiki.rubyonrails.com/rails/show/SaltedHashLoginGenerator > > > > -- > > Jonas Elfström > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > -- > sam > http://www.magpiebrain.com/ >-- Jonas Elfström
Jonas Elfström
2005-May-17 15:23 UTC
Re: Salted Hash Login Generator question -> problem solved
On 5/17/05, Bruno Mattarollo <bruno.mattarollo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The "undefined method ''l''" usually refers to the Localization not > being required properly.That was the problem. Thank you! I forgot to mention that I am running this on Windows and thus I also had to install iconv as explained here: http://groups-beta.google.com/group/comp.lang.ruby/browse_thread/thread/aa574c24b93d0e3d/ Now everything works (login, logout, change password, getting mails sent etc.) except forgot_passwordt: NoMethodError in User#change_password Showing /user/change_password.rhtml where line #2 raised: undefined method `errors'' for nil:NilClass Extracted source (around line #2): 1: <div title="<%= title_helper %>" class="form"> 2: <%= head_helper :error => true %> But don''t feel obliged to help because most probably I will sort it out after learning some more about the OO i Ruby. Thanks again!> The "head" of my application.rb controller looks like: > > require ''user_system'' > require ''localization'' > > class ApplicationController < ActionController::Base > include UserSystem > include Localization > > You should have something similar. > > Hope this helps, > > /B > > On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello, > > > > I''ve been wrestling with the Salted Hash Login Generator[1] for some > > time now and keep getting errors like: > > NoMethodError in User#login > > Showing /user/login.rhtml where line #2 raised: > > undefined method `l'' for #<ActionView::Base:0x3af0e80> > > > > Extracted source (around line #2): > > 1: <div title="<%= title_helper %>" class="form"> > > 2: <%= head_helper %> > > 3: <div class="form-padding"> > > 4: <%= start_form_tag_helper %> > > 5: <table> > > > > I guess it''s something very simple I have missed but I''m very new to > > Ruby on Rails and can''t seem to find out what. Can you point me in the > > right direction? > > Or do you know of complete Rails example project that uses the Salted > > Hash Login Generator? > > > > [1]http://wiki.rubyonrails.com/rails/show/SaltedHashLoginGenerator-- Jonas Elfström
>From memory (not at my dev computer atm) you seem to be missing someenvironment settings for the localization package in your environment.rb. When you generated the login pages using "ruby script/generate salted_login User Localization", you should of seen two README files generated - README_USER_LOGIN and README_LOCALIZATION. Check the information in README_LOCALIZATION and double check that you''ve followed all the steps. sam On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/17/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > OK, some information we need first: > > SORRY! > > > 1. Which version of rails > > 0.12.1 > > > 2. Which version of the salted hash login generator > > 1.0.8 > > > 3. Do your unit tests pass? > > Yes, I am very new to these tests but: > ruby test\unit\user_test.rb > and > ruby test\unit\places_test.rb > passes with no errors. places is my own scaffold test. > > > 4. Do your functional tests pass? > > No. Same error as already specified: > test_auth_bob(UserControllerTest): > NoMethodError: undefined method `l'' for #<UserController:0x39fa890> > ./test/functional/../../config/..//app/controllers/user_controller.rb:9:in > `login'' > > > 5. Can we see the changes you''ve made to: > > a.) Your environment.rb file > > Added at the end: > require ''environments/user_environment'' > > > b.) Your application controller > > In places_controller.rb (which is a super siple scaffolded controller > against a simple table with an id and to varchar fields), it works > fine until I add: > > class PlacesController < ApplicationController > > before_filter :login_required > > > Then we should be able to see what''s going on... > > Thanks in advance! > > PS. After digging out this information it feels like I should be able > to solve this myself but embarrasing enough I am not there yet. DS. > > > On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello, > > > > > > I''ve been wrestling with the Salted Hash Login Generator[1] for some > > > time now and keep getting errors like: > > > NoMethodError in User#login > > > Showing /user/login.rhtml where line #2 raised: > > > undefined method `l'' for #<ActionView::Base:0x3af0e80> > > > > > > Extracted source (around line #2): > > > 1: <div title="<%= title_helper %>" class="form"> > > > 2: <%= head_helper %> > > > 3: <div class="form-padding"> > > > 4: <%= start_form_tag_helper %> > > > 5: <table> > > > > > > I guess it''s something very simple I have missed but I''m very new to > > > Ruby on Rails and can''t seem to find out what. Can you point me in the > > > right direction? > > > Or do you know of complete Rails example project that uses the Salted > > > Hash Login Generator? > > > > > > [1]http://wiki.rubyonrails.com/rails/show/SaltedHashLoginGenerator > > > > > > -- > > > Jonas Elfström > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > -- > > sam > > http://www.magpiebrain.com/ > > > > -- > Jonas Elfström > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- sam http://www.magpiebrain.com/
raul-ojIHrzXdyXNg9hUCZPvPmw@public.gmane.org
2005-May-17 16:51 UTC
Re: Salted Hash Login Generator question
In the README_USER_LOGIN in the "create table" script is said "password" when it should be salted_password. With password it will create the user and allow to login with the emailed key but not subsequent logins, they will give an SQL exception when salted_password is used in the sql in the login process Quoting Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> >From memory (not at my dev computer atm) you seem to be missing some > environment settings for the localization package in your > environment.rb. When you generated the login pages using "ruby > script/generate salted_login User Localization", you should of seen > two README files generated - README_USER_LOGIN and > README_LOCALIZATION. Check the information in README_LOCALIZATION and > double check that you''ve followed all the steps. > > sam > > On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 5/17/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > OK, some information we need first: > > > > SORRY! > > > > > 1. Which version of rails > > > > 0.12.1 > > > > > 2. Which version of the salted hash login generator > > > > 1.0.8 > > > > > 3. Do your unit tests pass? > > > > Yes, I am very new to these tests but: > > ruby test\unit\user_test.rb > > and > > ruby test\unit\places_test.rb > > passes with no errors. places is my own scaffold test. > > > > > 4. Do your functional tests pass? > > > > No. Same error as already specified: > > test_auth_bob(UserControllerTest): > > NoMethodError: undefined method `l'' for #<UserController:0x39fa890> > > > ./test/functional/../../config/..//app/controllers/user_controller.rb:9:in > > `login'' > > > > > 5. Can we see the changes you''ve made to: > > > a.) Your environment.rb file > > > > Added at the end: > > require ''environments/user_environment'' > > > > > b.) Your application controller > > > > In places_controller.rb (which is a super siple scaffolded controller > > against a simple table with an id and to varchar fields), it works > > fine until I add: > > > > class PlacesController < ApplicationController > > > > before_filter :login_required > > > > > Then we should be able to see what''s going on... > > > > Thanks in advance! > > > > PS. After digging out this information it feels like I should be able > > to solve this myself but embarrasing enough I am not there yet. DS. > > > > > On 5/17/05, Jonas Elfström <jonelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello, > > > > > > > > I''ve been wrestling with the Salted Hash Login Generator[1] for some > > > > time now and keep getting errors like: > > > > NoMethodError in User#login > > > > Showing /user/login.rhtml where line #2 raised: > > > > undefined method `l'' for #<ActionView::Base:0x3af0e80> > > > > > > > > Extracted source (around line #2): > > > > 1: <div title="<%= title_helper %>" class="form"> > > > > 2: <%= head_helper %> > > > > 3: <div class="form-padding"> > > > > 4: <%= start_form_tag_helper %> > > > > 5: <table> > > > > > > > > I guess it''s something very simple I have missed but I''m very new to > > > > Ruby on Rails and can''t seem to find out what. Can you point me in the > > > > right direction? > > > > Or do you know of complete Rails example project that uses the Salted > > > > Hash Login Generator? > > > > > > > > [1]http://wiki.rubyonrails.com/rails/show/SaltedHashLoginGenerator > > > > > > > > -- > > > > Jonas Elfström > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > -- > > > sam > > > http://www.magpiebrain.com/ > > > > > > > -- > > Jonas Elfström > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > sam > http://www.magpiebrain.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.