Answer the question
In order to leave comments, you need to log in
How to get actual data from the database?
Good afternoon!
There is a code that displays records from a table
def count
while true
p Post.all
end
end
Answer the question
In order to leave comments, you need to log in
oO nothing is clear why the bike?
ActiveRecord Way
SQL WaySELECT COUNT(column_name) FROM table_name;
well, in the
controller piggy bank: @posts = Post.all
view
<% @posts.all.each do |p| %>
<%= p.title %>
<% end %>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question