I am new to Rails , i am trying to learn this technology , so please excuse if the question is dumb .
I am using Rails 3 .
Please let me know how can i insert a Record in the Database .
I am uisng postgresql , and below is my Table structure for the Students Table .
SELECT column_name FROM information_schema.columns WHERE table_name ='Students';
column_name
-------------
id
name
age
description
(4 rows)
This is my Controller file student_controller.rb
class StudentController < ApplicationController
def new
end
end
This is my Model file student.rb
class Student < ActiveRecord::Base
end
This is my view file under \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 in Database ??