I've got a pretty simple Ruby on Rails app that has a text box where I can enter content, limited to 200 characters, into a database.
My goal is to list the items below the text box so that when a user enters something, it appears at the top of an ever-growing list.
Right now I have some crappy code that doesn't work, but I'm not sure why.
In my view page, located at home.html.erb, I have this area for the lessons to be viewed in:
<td class="my-lessons">
</td>
In my Lesson controller I have the following:
def printLesson
@lesson = Lesson.find(params[:id])
puts @lesson.content
end
I'm not sure how to call printLesson in my code and just generally how to show the content of the Lessons database.
Any help would be greatly appreciated