ga-wdi-exercises / project2

[project]
1 stars 30 forks source link

Image not showing up #866

Closed StormyRamsey closed 7 years ago

StormyRamsey commented 7 years ago

Hello,

When I add an image url to a new or edit a post it does not show up. I can see the border for the image and the option to save it to Pinterest, but I cannot see the image itself. https://github.com/StormyRamsey/project_2_mommy_blog/tree/master/jeffs_mom

juancgarcia commented 7 years ago

Your code in the Article controller app/controllers/articles_controller.rb and show view app/views/articles/show.html.erb look correct, perhaps try retrieving the urls in the rails console rails c to make sure they are being stored in the articles.

You also mentioned something about a "save to Pinterest" option, but I don't see anything in your repo having to do with Pinterest. I'm guessing that you have some Chrome Extensions installed in your browser that could be breaking the display of images for you.

I recommend that you disable all of your Chrome Extensions while working on your assignments, as they can cause some serious issues like this. Go to this url in your Chrome browser: chrome://extensions/ and un-check the enabled checkbox for everything you see.

juancgarcia commented 7 years ago

If this problem is solved, please close the issue.

StormyRamsey commented 7 years ago

I made the changes to my Chrome settings, dropped, created and migrated my db and re-entered a new post, but the image is still not showing up.

StormyRamsey commented 7 years ago

Sorry about that replying from my phone and it went haywire.

AndyWhitley commented 7 years ago

Your new and edit forms need to be using text_field instead of file_field (also, make sure that it is linked to :img_url instead of :image. https://github.com/StormyRamsey/project_2_mommy_blog/blob/master/jeffs_mom/app/views/articles/new.html.erb#L23

AndyWhitley commented 7 years ago

Should be <%= f.text_field :img_url %>

AndyWhitley commented 7 years ago

Does that fix the problem?

StormyRamsey commented 7 years ago

Yup, fix it. Thank you very much.