Customer.find() will return a Customer object containing all the attributes of your Customer model (e.g. name, number, phone, email).
After you assign Customer to an instance variable (@customer = Customer.find(:all, :conditions => "id = cookies[:customer_id]")), you may bet the name in your view template using this embedded ruby:
Welcome <%= @customer.name %>
Hope this helps!
Thanks- That was indeed the problem. The next snag that I am
passing a value from the controller into the view. For example,
to pull the firstName of the logged in user and then say something
“welcome back <customer_name>”
In the controller I load in the customer info using Customer.find(:all,
:conditions => “id = cookies[:customer_id]”)
I get the right customer and i am able to extract the firstName from
returned array. But I can’t use it in my view.
What simple concept am I not getting. I thought that an field
controller was available in the view. Is this a scope issue?
assigning the value inside the def confirm method. But I need
in the confirm view also.
Posted via http://www.ruby-forum.com/.