Topic: Routes

I created a user for my application. I have a user sign_in, but I want a sign_up. Not sure how to add this route. I thought my Gem devise did that already, but it did not.

Thanks

Re: Routes

did you include the devise registerable module in your model?

Here's how it might look,  remove any modules you don't want:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable
end

make sure you have

devise_for :users

In routes.rb

<%= link_to('Sign Up', new_user_registration_path)  %>

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Routes

I need the <%= link_to('Sign Up', new_user_registration_path)  %> in the routes.rb?

I can browse to localhost:3000/users/sign_in and that shows up

If I just browse to localhost:3000/users I get No route matches [GET] "/users"

I am very new with programming

Thanks for any help you can provide

Re: Routes

No
<%= link_to('Sign Up', new_user_registration_path)  %>

goes in your view, it creates a link on your page that will take you to the sign_up page assuming you have one

You should have the following in your routes.rb

devise_for :users
resources :users

The first line sets up all the routes that devise requires

The second sets up the 7 RESTful routes for basic manipulation of the users table (index, edit, create, etc.)

if you ever what to know what routes you currently have set up,  cd to the root of your app and type

rake routes

if will dump out all of the defines routes.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Routes

Yeah I ran the rake routes yesterday, and found that I do not have a sign_up route.

Re: Routes

All of us use several websites to chat with friends, shopping online and many things like that. These websites have to log in every time we go there and the problem begins when we forget our username or password. The registration form has become an obvious part of many web sites that often web designers forget to pay enough attention to it, so they are easy to use.


bakelite sheets

Last edited by Abeellybond (2012-02-16 06:03:10)