0
Hello, I need the help of the noble holders of knowledge. I am studying Ruby on Rails through the Codecademy website. I took some things I learned there, and I tried to put it online on Heroku. It all worked out right at first, everything perfect. But suddenly, when trying to enter a specific page, it showed the following error:
Such an error is not shown in localhost. So I decided to start from scratch and deploy every step to find the problem. The problem was that, a normal page with pure html, opens quietly, but one with Ruby (inside the file) gives this problem.
The following code is generating the problem (I believe)
<% @messages.each do |message| %>
<div class="message">
<p class="content"><%= message.content %></p>
<p class="time"><%= message.created_at %></p>
</div>
<% end %>
The link to if you want to check in person is this:
https://segundoteste.herokuapp.com/
It has 2 buttons, the "Messages!" button has the above snippet in the code and shows the error. And the Test button has no error and shows no error.
Would anyone like to spend some time to help me? It will be of great help. Thank you.
Updating:
This is the controller of the page with problem.
File inside db/migrate:
Welcome, start by doing the Tour, good you set up the route in
routes.rb
?– NoobSaibot
Configured. Code follows: Rails.application.Routes.draw do <br> root 'pages#home' <br> get '/messages' => 'messages#index' <br> get '/testing' => 'testing#test' <br> # For Details on the DSL available Within this file, see <br>http://guides.rubyonrails.org/routing.html <br> end <br> No localhost works normally
– Leonardo Lima
Edith your question and put more information, how is this variable
messages
... See onHeroku
the application log.– NoobSaibot
Sorry ignorance, but how do I see the log? is what it shows after deploy?
– Leonardo Lima
https://devcenter.heroku.com/articles/logging
– NoobSaibot