lundi 29 août 2016

Rails/Sqlite 3 - Displaying table data on page

I'm very very very new to Rails, and I've got a fast approaching deadline to code my first rail app as part of a challenge.

I've so far created the basic blog application, to get my head around how rails works.

I need to display a list of all data held within a table on a page in my site. In blog, I've got an index page - which lists all blog posts so I've been trying to follow the same process.

I've created a populated table in my database, and a controller - but when I try and display info from that database on my page I get the following error:

uninitialized constant RecordsController::Aliens

class RecordsController < ApplicationController
    def index
        **@records= Records.all**
    end
end

All I want to achieve is a simple table, which has the list of my records in, so far I'm not having much look recalling the data from the database.

Any help appreciated!

Aucun commentaire:

Enregistrer un commentaire