Rafi A wrote in post #1076789: > Hi, > > See my comments inline: > > Regards, > Seeni Rafiyullah Khan A, > <srk...@apigee.com>*In Every moment, thank God.* > > > > On Thu, Sep 20, 2012 at 4:15 PM, ruby rails <li...@ruby-forum.com> > wrote: > >> >> >> >> >> > You are trying to get the admin name from the symbol :( and hence you > are > getting the issue. > > In the controller, assign the resultant admin record to the instance > variable as below: > > *@admin=Admin.find_by_email(params[:session][:email].downcase)* > > In your view page, use as below: > > *<%="Hi"%><%= @admin.name%> * > * > * HI,
I tried with the the below code. But still getting the same result in view page as "undefined method `name' for nil:NilClass" def create @admin=Admin.find_by_email(params[:session][:email].downcase) user=User.find_by_email(params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) redirect_to(dashboard_path(:user=>user)) else redirect_to(admins_index_path(:current_admin=>@admin)) end end -- Posted via http://www.ruby-forum.com/. -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.