1.use rails console to enter the console
#rails console
2.find the record, find, find_by_id, find_by_name
#subject = Subject.find(2)
#subject = Subject.find_by_id(2)
#subject = Subject.find_by_name("first subject")
3.find all record
#Subject.all
4.find first or last record
#Subject.first
#Subject.last
沒有留言:
張貼留言