Hi Guys,
recently started on rails. Currently trying to get images to load on
page
but the images are not loading, instead it just shows a white space
wherever i slot in images in my html code
Here are some of the code i have entered into my view/pages/home/html
file
but my images are not showing. anyone have any ideas?
Thanks in advance !
On Sat, Apr 5, 2014 at 1:36 AM, Elton Y. [email protected] wrote:
You can place the images in the assets\images folder and use image_tag
in
rails to generate the markup
This is the API Page for image_tag
http://apidock.com/rails/ActionView/Helpers/AssetTagHelper/image_tag
Thanks,
Ganesh
Sorry its a physical drag to the folder right ?
Hi Ganesh ! Thanks for the reply ! Sorry to be asking such fundamental
questions, but how can i place the images in the assets/images folder?
Thanks !
Elton
On Sat, Apr 5, 2014 at 2:11 AM, Elton Y. [email protected] wrote:
Sorry its a physical drag to the folder right ?
Yes you just need to move them. The best way to learn Rails from scratch
is this beginner tutorial by Michael H… He covers all aspects step
by
step in a very easy to understand way
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=4.0
Thank you so much Ganesh ! Just one question I have currently written
this
to call the image
However it is still not loading, do you happen to know why ?
Thanks again
Elton
On Sat, Apr 5, 2014 at 2:20 AM, Elton Y. [email protected] wrote:
<image_tag(“Happy_smiley_face”)>
Try this with the file extension (e.g. Happy_smiley_face.jpg) Also the
file should be in images folder and the casing should match if you are
running on Mac/Linux
On Fri, Apr 4, 2014 at 2:54 PM, Elton Y. [email protected] wrote:
This is the code I have, However the images are still not showing
<image_tag(“SAVEonSHIRTS_website_homepage_01.png”)>
Do you have any thoughts ?
Please work through a tutorial on Rails so you have some basic
knowledge of how views/ERB work.
Hint: there’s a major difference between
"<image_tag " and
"<%= image_tag "
Good luck.
Hassan S. ------------------------ [email protected]
twitter: @hassa
Hey Ganesh,
Sorry Ive been trying to use your method,
This is the code I have, However the images are still not showing
I have made sure that all the image names are the same already and that
they are stored in the images file in the assets file.
Do you have any thoughts ?