Here are the basic instructions I was given from my teacher to complete a website... Create a web page (.html.erb extension) that displays the following: Current time and date obtained from the Time object. An image of the sun if the time is between 6:00am and 6:00pm. An image of the moon if the time is between 6:00pm and 6:00am. The name of the current month. An image representing the current month. I''ve attached the controller and html.erb files that I was able to do so far. For some reason when I try to get the sun and moon to show up, i get an error message. Please help, thank you Attachments: http://www.ruby-forum.com/attachment/5951/Month.html.erb http://www.ruby-forum.com/attachment/5952/calendar_controller.rb -- 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-/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.
On Wed, Feb 23, 2011 at 4:37 PM, Dariusz S. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Here are the basic instructions I was given from my teacher to complete > a website... > > > Create a web page (.html.erb extension) that displays the following: > > Current time and date obtained from the Time object. > > An image of the sun if the time is between 6:00am and 6:00pm. An image > of the moon if the time is between 6:00pm and 6:00am. > > The name of the current month. > > An image representing the current month. > > > I''ve attached the controller and html.erb files that I was able to do so > far. For some reason when I try to get the sun and moon to show up, i > get an error message. Please help, thank you > > Post the error message, i guess it is unable to find the images as thepaths to the images are neither relative nor absolute.> Attachments: > http://www.ruby-forum.com/attachment/5951/Month.html.erb > http://www.ruby-forum.com/attachment/5952/calendar_controller.rb > > > -- > 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-/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. > >-- 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.
So what does that mean? How do I fix it? -- 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-/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.
On Wed, Feb 23, 2011 at 6:06 PM, Dariusz S. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> So what does that mean? How do I fix it? > > Post the error first. I said it was a guess, I am no GOD> -- > 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-/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. > >-- 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.
> So what does that mean? How do I fix it?It means we don''t know until we see the error message you are getting. Please post the error message. -- 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.
Bryan Crossland wrote in post #983396:>> So what does that mean? How do I fix it? > > It means we don''t know until we see the error message you are getting. > Please post the error message.I realize I may be crossing a line here by providing too much assistance, but I''m going to do it anyway just so you have an idea of how much unnecessary work your doing in your code. You''re not taking advantage of either Ruby, nor the Rails framework, in your attempt. Compare what you have with... http://pastie.textmate.org/private/mupvplmtwc3ae5hgahfjwg Note: This was a very quick refactoring of the OP code so don''t judge too harshly. I''m sure it could still be improved. I also didn''t not take the additional re-factoring step to move the controller logic into the model layer where it probably should belong. P.S. Remember DON''T PLAGIARIZE! Especially not for school work. I offer this code as an example to illustrate how to take advantage of the features of the language you''re working with. P.S.S. The answer to your question is there too, but I''ll leave that as an exercise for you to discover. -- 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-/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.