I'm new to Rails, I'm trying to learn this technology, so please excuse me if the question is dumb.
I am using Rails 3.
Please let me know how I can insert a record into the database.
I am uisng postgresql and below is my table structure for student table.
SELECT column_name FROM information_schema.columns WHERE table_name ='Students'; column_name
This is my student_controller.rb controller file
class StudentController < ApplicationController def new end end
This is my student.rb model file
class Student < ActiveRecord::Base end
This is my file with the view in \ app \ views \ student \ new.html.erb
<h1>BookController#new</h1> <form> Id: <input type="text" name="id" /><br /> Last Name: <input type="text" name="lastname" /> Age: <input type="text" name="age" /> Desciption: <input type="text" name="description" /> </form>
When I access http://localhost:3000/student/new
Please let me know how can I insert a record into the database?
source share