11 lines
485 B
Ruby
11 lines
485 B
Ruby
json.extract! student, :id, :first_name, :last_name, :email, :institution_id, :created_at, :updated_at
|
|
json.url student_url(student, format: :json)
|
|
// list refresh ചെയ്യുക
|
|
document.getElementById("students-list").innerHTML = "<%= j(render @students) %>";
|
|
|
|
// form clear ചെയ്യുക
|
|
document.getElementById("student-form").innerHTML = "<%= j(render 'form', student: Student.new) %>";
|
|
|
|
// success alert
|
|
alert("Student added successfully (without page reload!)");
|