Hi I create a simple application logintest first i create a controller using this command script/generate controller home index and define this controller as root. then i create a model like this script/generate model user user_name:string password:string create the controller the like this script/generate controller user index pri index.html.erb <% if flash[:notice] %> <div style="font-family:''Trebuchet MS''; color:#FF0000; font-size:14px;"> <%= flash[:notice] %> </div> <% end %> <!--creates form, exectues the authenticate method when the submit button is clicked--> <%= form_tag :action=>''authenticate'' %> User name: <%= text_field("userform", "user_name",:size=>"20" ) %> Password: <%= password_field("userform", "password",:size=>"20" ) %> <input type="submit" value=" LOGIN " /> pri.html.erb <!--#displays hello (username)--> hello <strong><%=session[:user_id]%></strong>. <!--#creates logout link, when the link is clicked, the controller is User and the method executed will be logout.--> <%= link_to "logout",:controller => "user", :action => "logout" %> user_controller.rb class UserController < ApplicationController def authenticate #User.new(params[:userform]) will create a new object of User, retrieve values from the form and store it variable @user. @user = User.new(params[:userform]) #find records with username,password valid_user = User.find(:first,:conditions => ["user_name = ? and password = ?",@user.user_name, @user.password]) #if statement checks whether valid_user exists or not if valid_user #creates a session with username session[:user_id]=valid_user.user_name #redirects the user to our private page. redirect_to :action => ''pri'' else flash[:notice] = "Invalid User/Password" redirect_to :action=> ''index'' end end def index end def pri if !session[:user_id] redirect_to :action=> ''index'' end end def logout if session[:user_id] reset_session redirect_to :action=> ''index'' end end end when i call this page using this code <%= link_to "login", user_path %> from my home/index.html.erb it shows the error NameError in Home#index Showing *app/views/home/index.html.erb* where line *#2* raised: undefined local variable or method `user_path'' for #<ActionView::Base:0xb66b60f0> How to solve this? Thanks in advance Regards, Suji A. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.