RichardOnRails
2010-Feb-27 00:30 UTC
Replacing an xxx.png with a xxx.jpg in public/images OK?
Hi ALL, I''m building a Rails app using the app provided in Ruby On Rails Cookbook. The book''s app works "out of the box" after appropriate tweaks: adding a "log" directory, adding a root password in database.yml and a couple of rake executions ... which is more than I can say for many books. (Just wanted to give it a plug.) In public/images he''s got a main_logo.png file which he references in the <body> of application.html.erb in ink_to image_tag(''main_logo.png''). I''ve got a .jpg that I''d use in place of a .png because my JPEG loses detail when I convert to PNG. I expect that JPEGs and GIFs and other major graphic encodings should work just as well in Rails as PNGs. Is that true? I ask because despite the fact that I''m using a working Rails app as guide, I''m confident I''ll make some mistakes I''ll have to debug. I''m just trying in advance to avoid one here. Thanks in advance, Richard -- 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.
Craig White
2010-Feb-27 00:48 UTC
Re: Replacing an xxx.png with a xxx.jpg in public/images OK?
On Fri, 2010-02-26 at 16:30 -0800, RichardOnRails wrote:> Hi ALL, > > I''m building a Rails app using the app provided in Ruby On Rails > Cookbook. The book''s app works "out of the box" after appropriate > tweaks: adding a "log" directory, adding a root password in > database.yml and a couple of rake executions ... which is more than I > can say for many books. (Just wanted to give it a plug.) > > In public/images he''s got a main_logo.png file which he references in > the <body> of application.html.erb in > ink_to image_tag(''main_logo.png''). > > I''ve got a .jpg that I''d use in place of a .png because my JPEG loses > detail when I convert to PNG. I expect that JPEGs and GIFs and other > major graphic encodings should work just as well in Rails as PNGs. Is > that true? > > I ask because despite the fact that I''m using a working Rails app as > guide, I''m confident I''ll make some mistakes I''ll have to debug. I''m > just trying in advance to avoid one here.---- Debugging and trying many things and causing errors is an essential part of the learning process itself. Rails is entirely indifferent to whatever you put into the ''image_tag'' because all it really does is create the normal <img src=""> html tag and then it''s up to the server to deliver the file and the web browser to parse it and display it. Also - FTR - when you say ''adding a root password in database.yml'' that immediately makes me nervous because root should never be the user of any sql database - at least in my opinion. Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- 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.
Conrad Taylor
2010-Feb-27 00:49 UTC
Re: Replacing an xxx.png with a xxx.jpg in public/images OK?
On Fri, Feb 26, 2010 at 4:30 PM, RichardOnRails < RichardDummyMailbox58407-gP6xRNRnnqSxhq/XJNNIW0EOCMrvLtNR@public.gmane.org> wrote:> Hi ALL, > > I''m building a Rails app using the app provided in Ruby On Rails > Cookbook. The book''s app works "out of the box" after appropriate > tweaks: adding a "log" directory, adding a root password in > database.yml and a couple of rake executions ... which is more than I > can say for many books. (Just wanted to give it a plug.) > > In public/images he''s got a main_logo.png file which he references in > the <body> of application.html.erb in > ink_to image_tag(''main_logo.png''). > > I''ve got a .jpg that I''d use in place of a .png because my JPEG loses > detail when I convert to PNG. I expect that JPEGs and GIFs and other > major graphic encodings should work just as well in Rails as PNGs. Is > that true? > >PNG, JPEG, and GIF has nothing really to do with Rails. The browser handles the displaying of images when a page is rendered. Thus, any of the above mentioned formats should work. However, you need to make sure that you''re referencing images correctly within your page. -Conrad> I ask because despite the fact that I''m using a working Rails app as > guide, I''m confident I''ll make some mistakes I''ll have to debug. I''m > just trying in advance to avoid one here. > > Thanks in advance, > Richard > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@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.
RichardOnRails
2010-Feb-27 01:03 UTC
Re: Replacing an xxx.png with a xxx.jpg in public/images OK?
Hi Craig, Thanks for your advice.> Rails is entirely indifferent to whatever you put into the ''image_tag''That''s what I expected. Asking about it is like taking a Flu shot: it wards off possible ills.> root should never be the user of any sql database ...I agree, with the exception of my machine that is: - protected from the Net and malware - I am the sole user - and it''s only for development purposes BTW, that''s how the author posted the code. On Feb 26, 7:48 pm, Craig White <craigwh...-BQ75lA0ptkhBDgjK7y7TUQ@public.gmane.org> wrote:> On Fri, 2010-02-26 at 16:30 -0800, RichardOnRails wrote: > > Hi ALL, > > > I''m building a Rails app using the app provided in Ruby On Rails > > Cookbook. The book''s app works "out of the box" after appropriate > > tweaks: adding a "log" directory, adding a root password in > > database.yml and a couple of rake executions ... which is more than I > > can say for many books. (Just wanted to give it a plug.) > > > In public/images he''s got a main_logo.png file which he references in > > the <body> of application.html.erb in > > ink_to image_tag(''main_logo.png''). > > > I''ve got a .jpg that I''d use in place of a .png because my JPEG loses > > detail when I convert to PNG. I expect that JPEGs and GIFs and other > > major graphic encodings should work just as well in Rails as PNGs. Is > > that true? > > > I ask because despite the fact that I''m using a working Rails app as > > guide, I''m confident I''ll make some mistakes I''ll have to debug. I''m > > just trying in advance to avoid one here. > > ---- > Debugging and trying many things and causing errors is an essential part > of the learning process itself. > > Rails is entirely indifferent to whatever you put into the ''image_tag'' > because all it really does is create the normal <img src=""> html tag > and then it''s up to the server to deliver the file and the web browser > to parse it and display it. > > Also - FTR - when you say ''adding a root password in database.yml'' that > immediately makes me nervous because root should never be the user of > any sql database - at least in my opinion. > > Craig > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean.-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
RichardOnRails
2010-Feb-27 01:12 UTC
Re: Replacing an xxx.png with a xxx.jpg in public/images OK?
Hi Conrad, Thanks for your response.> PNG, JPEG, and GIF has nothing really to do with Rails.Great! I couldn''t how enacting my plan could run afoul of Rails. But there''s always the possibility that I overlooked something. So I sought advice from more experience Rails people.> you need to make sure that you''re referencing images correctly within your page.I got that covered in this case; I''m paralleling a working app. Best wishes, Richard On Feb 26, 7:49 pm, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Fri, Feb 26, 2010 at 4:30 PM, RichardOnRails < > > > > RichardDummyMailbox58...-gP6xRNRnnqSxhq/XJNNIW0EOCMrvLtNR@public.gmane.org> wrote: > > Hi ALL, > > > I''m building a Rails app using the app provided in Ruby On Rails > > Cookbook. The book''s app works "out of the box" after appropriate > > tweaks: adding a "log" directory, adding a root password in > > database.yml and a couple of rake executions ... which is more than I > > can say for many books. (Just wanted to give it a plug.) > > > In public/images he''s got a main_logo.png file which he references in > > the <body> of application.html.erb in > > ink_to image_tag(''main_logo.png''). > > > I''ve got a .jpg that I''d use in place of a .png because my JPEG loses > > detail when I convert to PNG. I expect that JPEGs and GIFs and other > > major graphic encodings should work just as well in Rails as PNGs. Is > > that true? > > PNG, JPEG, and GIF has nothing really to do with Rails. The browser > handles the displaying of images when a page is rendered. Thus, any of > the above mentioned formats should work. However, you need to make > sure that you''re referencing images correctly within your page. > > -Conrad > > > I ask because despite the fact that I''m using a working Rails app as > > guide, I''m confident I''ll make some mistakes I''ll have to debug. I''m > > just trying in advance to avoid one here. > > > Thanks in advance, > > Richard > > > -- > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.