Hello from a Ruby on Rails beginner!
This is the code in controller. @courses variable find the data from
class CoursesController < ApplicationController
@courses = Course.find(:all)
The following code show the data in browser with no problem. That means
<%= @courses.to_json %>
But the following code doesn’t show data in browser right. The output is
a string of “undefined”.
I don’t know what goes wrong. Please help. Thank you in advance.