Rails 4 favicon in localhost - ruby-on-rails

I created a favicon for a rails app I've built a month ago. Now I'm working on a new app without a particular favicon, yet every time I go to localhost:3000 the old favicon appears. I know it really doesn't matter and it won't appear in production but it bugs me. Can anyone explain why it keeps showing and how can I remove it?
Thanks.

The reason is simple, the browser is being smart and caches the favicon as it associates it with the URL, i.e. http://localhost:3000.
To test it in Chrome, just open http://localhost:3000 in an incognito window (CTRL+SHIFT+N) and you will not see the favicon there.
To remove the favicon, simply clear the browser cache.

It appears in development on localhost:3000 because it got cached.if run your server on different port like 4000(rails s -p 4000) and access localhost:4000 then it won't show you the old favicon.

Related

Rails server gets response, but localhost page hangs randomly until system reboot

I'm working on a project with a Rails 6.0 backend using webpacker with a React frontend. While working on the frontend with the rails server, my app will sometimes break on Google Chrome, endlessly loading but never even showing the new page title on the tab.
The rails server is receiving the request. It will hit debuggers in the backend and it returns with a 200 status code, but Chrome refuses to load the page while giving no errors or messages indicating what is wrong. This persists even after I restart the rails server, if I restart it on a different port, and if I restart the webpack dev server. I've tried clearing my cache and disabling the cache with devtools, but the only thing that fixes it is rebooting my entire system.
It seems to happen randomly, though I think it may be happening if I refresh the page out of the chrome debugger. I am using ajax for calls to my backend API, not sure if that's possibly a factor.
I've never had this problem before and I'm unsure what it even possibly could be. Does anyone have any idea what might be happening here?

iOS Safari loads a wrong page

I've met a very strange bug when tried to open my web site http://akr-congress2016.ru/ in iOS Safari. Please see the screenshot below.
It seems like some elements are loaded from a completely other web site. The new site is a copy of the old one, but layout files (I'm using Phalcon) are changed. There is no link to the old web site at the page.
Also I've noticed doubled logo, it seems like a rendering bug.
When I refresh the page it is loaded normally.
I'm weird what might make Safari to load some fragments of the page from completely another domain.
The screenshot
Try to remove cache from browser. Or maybe it's just an issue of DNS. In that case you just need to wait untill DNS will get updated.

How to stop localhost http://localhost from switching to https://localhost

I am writing a web application, and http://localhost:3000 is redirecting to https://localhost:3000
This was not happening a month ago when I finished writing two other applications. I went from working with Sinatra to Rails in the past month, although I have worked with Rails prior without any of these issues.
What can I do to stop this forced switching??
This is probably due your browser, because you have accessed the app in the HTTPS address, it will automatically switch to the HTTPS version of site.
Here you have more information for Firefox, but the solution is to change the settings and set browser.urlbar.autoFill to false. Other option could be to clear the History.

Session errors when accessing a development Rails app through VirtualBox

I'm developing a Rails 3 app on Ubuntu 10.10 and need to check the CSS and Javascript on IE7 and IE8, so I'm using VirtualBox and the images that Microsoft provides. I've gotten the images installed and running well - I can use IE7 and IE8 to access the internet and use sites just fine.
I can also access my development Rails app (running on Ubuntu) by visiting 10.0.2.2:3000 in each browser (not sure why that works and localhost doesn't, but oh well). Any GET on a page that doesn't require the user to be logged in renders as I'd expect it to.
What's wrong are the sessions - as near as I can tell, both IE7 and IE8 are both just completely ignoring sessions with the development app. Whenever I submit the login form I get an InvalidAuthenticityToken error, and sure enough, in Rails' error page, the values in the session and params don't match. I even set up a special route to automatically log in the visitor as a random user, but it doesn't work. I just downloaded and installed Firefox in one of the virtual PCs and it's having the same problem as the IEs are.
Everything works perfectly in Chrome/Firefox in Ubuntu, so it doesn't seem to be Rails, and apparently it's not IE. I suppose there's something I'm missing with VirtualBox, but I have zero experience with virtualization before today, so I don't even know how to begin troubleshooting it.
Any advice?
Figured it out: The cookie wasn't being set because I was visiting the app through the ip address (Rails' :domain => :all option for the cookie store apparently doesn't cover that eventuality). I pointed lvh.me to 10.0.2.2 in the hosts file in WinXP, and everything works great.
I just had a similar problem on IE8, session cookies were turned off. My Rails app login worked after I turned session cookies to on via:
Internet Explorer > Tools > Internet Options > Privacy tab > Advanced button > tick "Always allow session cookies"

Rails, my stylesheet disappears magically?

Ok I just started a rails project...when i initially load the page it's styled as it's supposed to be. Without changing any code when I refresh the stylesheet disappears. I figured maybe it was a html/css error, but then if i close my browser and reopen it the page shows up fine again. So it's not that. I'm in dev mode so I don't think it's a cache issue. It happens in both firefox and chromium.
Just give Mongrel or Thin a try

Resources