Sorry - working on a simple tutorial but something is throwing me here. I''m supposed to get a Time.now() print to the page but it''s not working and I can''t figure out why. No errors are thrown my the page shows: Howdy, world! My name is Stuart Felenstein. This was verified at . So no time stamp showing. I went into IRB , did a Time.now() and it''s working there so am I missing something ? In my controller: class NamerController < ApplicationController def index @my_name = ''Stuart'' end def timestamped @my_name = ''Stuart'' @the_timestamp = Time.now() end end In my view <html> <head> <title> I''m timestamped at <%= @the_timestamp %> </title> </head> <body> Howdy, world! My name is <%= @my_name %>.<br/> This was verified at <%= @the_timestamp %>. </body> </html> TIA Stuart
Are you sure you''re running the timestamped action to produce the view? If you''re looking at index.rhtml, your timestamped action is not getting called. On 6/17/06, Dark Ambient <sambient@gmail.com> wrote:> Sorry - working on a simple tutorial but something is throwing me > here. I''m supposed to get a Time.now() print to the page but it''s not > working and I can''t figure out why. > No errors are thrown my the page shows: > > Howdy, world! My name is Stuart Felenstein. > This was verified at . > > So no time stamp showing. I went into IRB , did a Time.now() and it''s > working there so am I missing something ? > > In my controller: > > class NamerController < ApplicationController > def index > @my_name = ''Stuart'' > end > def timestamped > @my_name = ''Stuart'' > @the_timestamp = Time.now() > end > end > > In my view > > <html> > <head> > <title> > I''m timestamped at <%= @the_timestamp %> > </title> > </head> > <body> > Howdy, world! My name is <%= @my_name %>.<br/> > This was verified at <%= @the_timestamp %>. > </body> > </html> > > TIA > Stuart > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Well creating the timestamp view didn''t come till later in the tutorial, although the screenshots showed it should have displayed in the index.rhtml. Now that''s I''ve created the timestamp.rhtml it is working there. I have a feeling though this tutorial isn''t ready for primetime. Stuart On 6/17/06, TJ Stankus <tj@stank.us> wrote:> Are you sure you''re running the timestamped action to produce the > view? If you''re looking at index.rhtml, your timestamped action is not > getting called. > > On 6/17/06, Dark Ambient <sambient@gmail.com> wrote: > > Sorry - working on a simple tutorial but something is throwing me > > here. I''m supposed to get a Time.now() print to the page but it''s not > > working and I can''t figure out why. > > No errors are thrown my the page shows: > > > > Howdy, world! My name is Stuart Felenstein. > > This was verified at . > > > > So no time stamp showing. I went into IRB , did a Time.now() and it''s > > working there so am I missing something ? > > > > In my controller: > > > > class NamerController < ApplicationController > > def index > > @my_name = ''Stuart'' > > end > > def timestamped > > @my_name = ''Stuart'' > > @the_timestamp = Time.now() > > end > > end > > > > In my view > > > > <html> > > <head> > > <title> > > I''m timestamped at <%= @the_timestamp %> > > </title> > > </head> > > <body> > > Howdy, world! My name is <%= @my_name %>.<br/> > > This was verified at <%= @the_timestamp %>. > > </body> > > </html> > > > > TIA > > Stuart > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Yep, sounds like a buglet in the tutorial. Perhaps let the tutorial author know about it. Cheers, -TJ On 6/17/06, Dark Ambient <sambient@gmail.com> wrote:> Well creating the timestamp view didn''t come till later in the > tutorial, although the screenshots showed it should have displayed in > the index.rhtml. > Now that''s I''ve created the timestamp.rhtml it is working there. > > I have a feeling though this tutorial isn''t ready for primetime. > > Stuart > > > > On 6/17/06, TJ Stankus <tj@stank.us> wrote: > > Are you sure you''re running the timestamped action to produce the > > view? If you''re looking at index.rhtml, your timestamped action is not > > getting called. > > > > On 6/17/06, Dark Ambient <sambient@gmail.com> wrote: > > > Sorry - working on a simple tutorial but something is throwing me > > > here. I''m supposed to get a Time.now() print to the page but it''s not > > > working and I can''t figure out why. > > > No errors are thrown my the page shows: > > > > > > Howdy, world! My name is Stuart Felenstein. > > > This was verified at . > > > > > > So no time stamp showing. I went into IRB , did a Time.now() and it''s > > > working there so am I missing something ? > > > > > > In my controller: > > > > > > class NamerController < ApplicationController > > > def index > > > @my_name = ''Stuart'' > > > end > > > def timestamped > > > @my_name = ''Stuart'' > > > @the_timestamp = Time.now() > > > end > > > end > > > > > > In my view > > > > > > <html> > > > <head> > > > <title> > > > I''m timestamped at <%= @the_timestamp %> > > > </title> > > > </head> > > > <body> > > > Howdy, world! My name is <%= @my_name %>.<br/> > > > This was verified at <%= @the_timestamp %>. > > > </body> > > > </html> > > > > > > TIA > > > Stuart > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Yes, the book is "beta", probably more alpha though. Thanks for the clarification. Stuart On 6/17/06, TJ Stankus <tj@stank.us> wrote:> Yep, sounds like a buglet in the tutorial. Perhaps let the tutorial > author know about it. > > Cheers, > > -TJ > > On 6/17/06, Dark Ambient <sambient@gmail.com> wrote: > > Well creating the timestamp view didn''t come till later in the > > tutorial, although the screenshots showed it should have displayed in > > the index.rhtml. > > Now that''s I''ve created the timestamp.rhtml it is working there. > > > > I have a feeling though this tutorial isn''t ready for primetime. > > > > Stuart > > > > > > > > On 6/17/06, TJ Stankus <tj@stank.us> wrote: > > > Are you sure you''re running the timestamped action to produce the > > > view? If you''re looking at index.rhtml, your timestamped action is not > > > getting called. > > > > > > On 6/17/06, Dark Ambient <sambient@gmail.com> wrote: > > > > Sorry - working on a simple tutorial but something is throwing me > > > > here. I''m supposed to get a Time.now() print to the page but it''s not > > > > working and I can''t figure out why. > > > > No errors are thrown my the page shows: > > > > > > > > Howdy, world! My name is Stuart Felenstein. > > > > This was verified at . > > > > > > > > So no time stamp showing. I went into IRB , did a Time.now() and it''s > > > > working there so am I missing something ? > > > > > > > > In my controller: > > > > > > > > class NamerController < ApplicationController > > > > def index > > > > @my_name = ''Stuart'' > > > > end > > > > def timestamped > > > > @my_name = ''Stuart'' > > > > @the_timestamp = Time.now() > > > > end > > > > end > > > > > > > > In my view > > > > > > > > <html> > > > > <head> > > > > <title> > > > > I''m timestamped at <%= @the_timestamp %> > > > > </title> > > > > </head> > > > > <body> > > > > Howdy, world! My name is <%= @my_name %>.<br/> > > > > This was verified at <%= @the_timestamp %>. > > > > </body> > > > > </html> > > > > > > > > TIA > > > > Stuart > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >