SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simply Rails 2 Chp 8 Creating User? p 258

    I am on chapter 8 of Simply Rails 2 and I am working on creating a user. As far as I can tell, this book does not help setup a "registration page". Instead you are directed to create a user on page 258. Is there anyway to setup a simple registration page so other people can register?

  2. #2
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, when I try to create a user following p 258, I get the following errors:

    Code:
    >> u = User.new
    NameError: uninitialized constant User
    	from (irb):1

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,189
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Hi sammyman, welcome to the forums,

    The next chapter deals with the login process in depth. But as for a registration form, from pg. 349
    .....
    Of course, there are countless enhancements that we could make to our little application; some of the functionality that comes to mind includes:

    ■ creating a form that allows new users to register
    ■ sending an email to new users to inform them of their passwords
    ■ encrypting user passwords in the database
    ■ allowing users to comment on stories
    ■ restricting users to vote for each story only once

    I’m sure your mind is racing with ideas for a number of spectacular features that could set your application apart from the pack! While the addition of all of these features is more than we could possibly cover in this book, I’ve given you a solid grounding—both in theory and in practice—that you can build on to further develop Shovell on your own.
    .....
    so no, the book does not cover a registration form.

    Re NameError, did 255 run OK without errors?
    ...> ruby script/generate model User login:string password:string name:string email:string
    And you did the file modifications correctly and the migration went OK?

  4. #4
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Hi sammyman, welcome to the forums,

    The next chapter deals with the login process in depth. But as for a registration form, from pg. 349

    so no, the book does not cover a registration form.

    Re NameError, did 255 run OK without errors?

    And you did the file modifications correctly and the migration went OK?
    Thanks for the reply. 255 did run fine without errors.

    I think I may be having a problem with my mysql3 installation. I recently upgraded to Snow Leopard about a month ago which I believe could be the culprit.

  5. #5
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Hi sammyman, welcome to the forums,

    The next chapter deals with the login process in depth. But as for a registration form, from pg. 349

    so no, the book does not cover a registration form.

    Re NameError, did 255 run OK without errors?

    And you did the file modifications correctly and the migration went OK?

    I did do 255 without errors. Today, I tried to retrace my steps and I deleted apps/models/user.rb and 003_create_users.rb, and recreated model User. Then I tried to migrate with the following error:

    Code:
    rake aborted!
    An error has occurred, this and all later migrations canceled:
    
    SQLite3::SQLException: table "users" already exists: CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "login" varchar(255), "password" varchar(255), "name" varchar(255), "email" varchar(255), "created_at" datetime, "updated_at" datetime)
    I still have no way to create a user which is hard because I want to test out the application.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •