user registration form example?

Hello, anyone can guide me through creating a user registration form in rails from scratch (without the scaffold command thou), using first the inbuilt sqlite3 db and then with mysql?

I was having a look at the following tutotial, but lost my way in the first part itself where it mentions the creation of index, register etc: http://rails.francik.name/tutorial/chapter/5

Help with this will be much appreciated as I need to start implement a registration form in the shortest time possible...

Did you start at the beginning of the tutorial or try to jump in at that chapter? If you jumped in and do not understand what is going on then you need to start at the beginning.

If you don't like that tutorial then have a look at railstutorial.org, which I found good and is free to use online. Don't skip bits because you are in a hurry, work right through it including all the exercises and so on.

Colin

thanks Colin, in fact due to be in a hurry i skipped the other parts and went straight to the chapter I was concerned with, but since am a newbie with rails and ruby, I lost track of what was going on and was dreading to start from the beginning due to time constraint

Please remember to quote the previous message so that it is easier to follow the thread. This is a mailing list though you may be accessing it through a forum interface.

thanks Colin, in fact due to be in a hurry i skipped the other parts and went straight to the chapter I was concerned with, but since am a newbie with rails and ruby, I lost track of what was going on and was dreading to start from the beginning due to time constraint

More haste, less speed. You cannot expect to solve complex problems until you know how to solve easy ones.

Colin

Hello again, this time I followed the tutorial mentioned previously, however, when am opening localhost:3000/user/register, am only getting the heading <h1>, but not the form. my code:

<h1>Register</h1> <div> <% form_for :user do |f| %>   <p>     <%= f.label :name %>:     <%= f.text_field :name %>   </p>   <p>     <%= f.label :email, "E-Mail" %>:     <%= f.text_field :email %>   </p>   <p>     <%= f.label :password %>:     <%= f.password_field :password %>   </p>   <p>     <%= f.submit "Register" %>   </p> <% end %> </div>

Check the tutorial again, that should <%= (not <%) and @user (not :user) where @user is a user object.

Colin

thanks for the <%= I was referring to this tutorial again: http://rails.francik.name/tutorial/chapter/5#23

It uses :user instead of @user for the form creation

However I could not get it to work with the @user, had to use :user to load the form in browser.

Another problem am getting when am clicking on Register button for the form is :

Routing Error

No route matches [POST] "/user/register"

Try running rake routes for more information on available routes.

am using the default sqlite3 to manage the db, and in the routes.rb I only have get "user/register" get "user/index" get "user/login" get "user/logout" since I followed the example, with a bunch of comments which follow

I managed to solve the route problem :slight_smile:

is there a way to encrypt the password value being stored in development.sqlite3? so far when I open it I can see the values as plain text

I think the tutorial at railstutorial.org will show you how to do that.

Colin