The images in my program aren''t appearing. They''re all housed in public/images so I was hoping that I could modify routes.rb to point the program in the right direciton. The page that has the images has the typical image html code: <img src="images/barb1.png"> Now I know that if I add a ''/'' in front of images, the image will show up, but this page has approximately 100 pictures generated automatically by a program every time it''s called and I''d rather do this painlessly. Looking at the picture''s property, the pictures are pointed at "http:// localhost:3000/[controller]/images/barb1.jpg" when it should be "http://localhost:3000/images/barb1.jpg" I know squat about routes despite reading Agile Web Development with Rails, two other relatively thick books, and multiple articles on the web. I''ve tried many different ways to define the routes in hopes of stumbling on the answer, but have failed thus far so I have turned to this awesome commnuity. Any help would be appreciated with suggestions on what the correct code is to put in routes.rb Thanks, Anon_comp -- 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 Jun 2, 2:31 pm, anon_comp <neocools...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The images in my program aren''t appearing. They''re all housed in > public/images so I was hoping that I could modify routes.rb to point > the program in the right direciton. > > The page that has the images has the typical image html code: > > <img src="images/barb1.png"> > > Now I know that if I add a ''/'' in front of images, the image will show > up, but this page has approximately 100 pictures generated > automatically by a program every time it''s called and I''d rather do > this painlessly. > > Looking at the picture''s property, the pictures are pointed at "http:// > localhost:3000/[controller]/images/barb1.jpg" when it should be > "http://localhost:3000/images/barb1.jpg" > > I know squat about routes despite reading Agile Web Development with > Rails, two other relatively thick books, and multiple articles on the > web. I''ve tried many different ways to define the routes in hopes of > stumbling on the answer, but have failed thus far so I have turned to > this awesome commnuity. > > Any help would be appreciated with suggestions on what the correct > code is to put in routes.rb > > Thanks, > Anon_compIgnore. Problem solved. Anon_comp -- 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.
Can you share how you solved it? Am facing a similar situation. On Jun 3, 1:11 am, anon_comp <neocools...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 2, 2:31 pm, anon_comp <neocools...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > The images in my program aren''t appearing. They''re all housed in > > public/images so I was hoping that I could modify routes.rb to point > > the program in the right direciton. > > > The page that has the images has the typical image html code: > > > <img src="images/barb1.png"> > > > Now I know that if I add a ''/'' in front of images, the image will show > > up, but this page has approximately 100 pictures generated > > automatically by a program every time it''s called and I''d rather do > > this painlessly. > > > Looking at the picture''s property, the pictures are pointed at "http:// > > localhost:3000/[controller]/images/barb1.jpg" when it should be > > "http://localhost:3000/images/barb1.jpg" > > > I know squat about routes despite reading Agile Web Development with > > Rails, two other relatively thick books, and multiple articles on the > > web. I''ve tried many different ways to define the routes in hopes of > > stumbling on the answer, but have failed thus far so I have turned to > > this awesome commnuity. > > > Any help would be appreciated with suggestions on what the correct > > code is to put in routes.rb > > > Thanks, > > Anon_comp > > Ignore. Problem solved. > Anon_comp-- 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.
On Jun 3, 12:48 am, Arun Srini <arunro...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you share how you solved it? Am facing a similar situation.Sure thing. This may or may not be your situation considering that my page was an outside-program-generated .html page. If it is then all you have to do is move the page to the public folder. You can put it in it''s own folder and have an "images" folder within that folder so the page can find the images (ie. public\hello \images). Or just leave the page under the public folder and place the images in "public\images" I wish you luck :)> On Jun 3, 1:11 am, anon_comp <neocools...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Jun 2, 2:31 pm, anon_comp <neocools...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > The images in my program aren''t appearing. They''re all housed in > > > public/images so I was hoping that I could modify routes.rb to point > > > the program in the right direciton. > > > > The page that has the images has the typical image html code: > > > > <img src="images/barb1.png"> > > > > Now I know that if I add a ''/'' in front of images, the image will show > > > up, but this page has approximately 100 pictures generated > > > automatically by a program every time it''s called and I''d rather do > > > this painlessly. > > > > Looking at the picture''s property, the pictures are pointed at "http:// > > > localhost:3000/[controller]/images/barb1.jpg" when it should be > > > "http://localhost:3000/images/barb1.jpg" > > > > I know squat about routes despite reading Agile Web Development with > > > Rails, two other relatively thick books, and multiple articles on the > > > web. I''ve tried many different ways to define the routes in hopes of > > > stumbling on the answer, but have failed thus far so I have turned to > > > this awesome commnuity. > > > > Any help would be appreciated with suggestions on what the correct > > > code is to put in routes.rb > > > > Thanks, > > > Anon_comp > > > Ignore. Problem solved. > > Anon_comp- Hide quoted text - > > - Show quoted text --- 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.
On Jun 2, 8:31 pm, anon_comp <neocools...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I know squat about routes despite reading Agile Web Development with > Rails, two other relatively thick books, and multiple articles on the > web. I''ve tried many different ways to define the routes in hopes of > stumbling on the answerDoesn''t <%= image_tag(''some_image.png'') %> always produce an image tag pointing to /images/some_image.png regardless of which view it is being called from? -- 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.
On Jun 3, 9:14 am, Sharagoz <shara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Doesn''t <%= image_tag(''some_image.png'') %> always produce an image tag > pointing to /images/some_image.png regardless of which view it is > being called from?Yes it does, but read the paragraphs before that to see that the rendered page uses a normal html img call and that it occurs about 100 times. But your suggestion is completely correct :) -- 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.
On Jun 3, 5:40 pm, anon_comp <neocools...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 3, 9:14 am, Sharagoz <shara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Yes it does, but read the paragraphs before that to see that the > rendered page uses a normal html img call and that it occurs about 100 > times. But your suggestion is completely correct :)So you''re saying that you don''t have control over the image tags that are being generated in your views? That sounds like a bad position to be in. I have no idea how you would go about manipulating the routing to redirect calls to image files. What is generating the image tags? -- 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.
On Jun 3, 11:54 am, Sharagoz <shara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So you''re saying that you don''t have control over the image tags that > are being generated in your views? That sounds like a bad position to > be in. I have no idea how you would go about manipulating the routing > to redirect calls to image files. What is generating the image tags?Yes, I don''t have control over the image tags that are being generated. I didn''t need to route; it was simply a relocation issue. The problem has been fixed and this thread is closed, but I do appreciate that you are willing to give help. Although...there is another person who may seek your help by the name of "Arun Srini" so just keep an eye out for his/her post from now on. -- 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.