Friday, September 4, 2015

When things go off the rails

... and then I was dealing with my website, which I intend to make available to public in a few days. Everything is ok and I am now joining the pieces together. This is the image of the homepage.

As you may see, this this homepage is the view Welcome#index. And, of course, my config/routes.rb says

get 'welcome/index'
root 'welcome#index'

as it must be. But that single button saying "Homepage" is defined by

<a class="btn btn-block" href="/welcome/index">Homepage</a>

and then points to the same root route, right?

Then, why when I click the button I got this?

Yeah! My beautiful bootstrap carousel now displays no images!

I saw the trace of the server, I asked some expert friends... nothing! Nobody may point me a reason for this to happen!

Then I suddenly realized that sometimes things go off the rails. And I mean no pun when I say this! It's is not just Ruby on Rails, but every programming language sometimes goes off the rails and does exactly what we don't want it to do.

Why does this happens? Who knows! Maybe only God, in His infinite wisdom, knows the reason why programming languages sometimes tend to make us crazy.

This blog is focused on Ruby on Rails, but sometimes I'll talk about other programming languages I use to deal with, like PHP and Javascript...

Oh, please, don't get me started about Javascript! According to AndrĂ© Guanabara, a friend of mine from Rio de Janeiro, Javascript is a language that tends to make you go from heaven to hell, and all the way back to heaven, in just a few moments. A very powerful language, indeed, but also one of the hardest to deal with, according to his opinion and mine. Even when you use things like jQuery, a life-saving library. jQuery surely saved the sanity of many  programmers, but it also have its tricks.

These things happen for us to understand our mothers when they told us to choose simple and lucrative professions, such as brain surgery ... That's what I sometimes think.

By the way... may someone help me with my bootstrap carousel?