Class | StudentsController
In: | app/controllers/students_controller.rb
Parent: | ApplicationController

### Methods

create destroy edit index new show summary update

### Public Instance methods

create()

POST /students POST /students.xml

[Source]

        # File app/controllers/students_controller.rb, line 51
    51:   def create
    52:     @student = Student.new(params[:student])
    53:
    54:     respond_to do |format|
    55:       if @student.save
    56:         flash[:notice] = 'Student was successfully created.'
    57:         format.html { redirect_to(@student) }
    58:         format.xml  { render :xml => @student, :status => :created, :location => @student }
    59:       else
    60:         format.html { render :action => "new" }
    61:         format.xml  { render :xml => @student.errors, :status => :unprocessable_entity }
    62:       end
    63:     end
    64:   end

destroy()

DELETE /students/1 DELETE /students/1.xml

[Source]

        # File app/controllers/students_controller.rb, line 87
    87:   def destroy
    88:     @student = Student.find(params[:id])
    89:     flash[:notice] =
    90:     "Be aware that student: #{@student.name} and his/her individual grades have been deleted."
    91:     @student.destroy
    92:
    93:     respond_to do |format|
    94:       format.html { redirect_to(students_url) }
    95:       format.xml  { head :ok }
    96:     end
    97:   end

edit()

GET /students/1/edit

[Source]

        # File app/controllers/students_controller.rb, line 45
    45:   def edit
    46:     @student = Student.find(params[:id])
    47:   end

index()

GET /students GET /students.xml

[Source]

        # File app/controllers/students_controller.rb, line 4
     4:   def index
     5:     @students = Student.all
     6:
     7:     respond_to do |format|
     8:       format.html # index.html.erb
     9:       format.xml  { render :xml => @students }
    10:     end
    11:   end

new()

GET /students/new GET /students/new.xml

[Source]

        # File app/controllers/students_controller.rb, line 35
    35:   def new
    36:     @student = Student.new
    37:
    38:     respond_to do |format|
    39:       format.html # new.html.erb
    40:       format.xml  { render :xml => @student }
    41:     end
    42:   end

show()

GET /students/1 GET /students/1.xml

[Source]

        # File app/controllers/students_controller.rb, line 15
    15:   def show
    16:     @student = Student.find(params[:id])
    17:
    18:     respond_to do |format|
    19:       format.html # show.html.erb
    20:       format.xml  { render :xml => @student }
    21:     end
    22:   end

summary()

[Source]

        # File app/controllers/students_controller.rb, line 24
    24:   def summary
    25:     @igrade = Igrade.find(params[:id])
    26:
    27:     respond_to do |format|
    28:       format.html # summary.html.erb
    29:       format.xml  { render :xml => @igrade }
    30:     end
    31:   end

update()

PUT /students/1 PUT /students/1.xml

[Source]

        # File app/controllers/students_controller.rb, line 70
    70:   def update
    71:     @student = Student.find(params[:id])
    72:
    73:     respond_to do |format|
    74:       if @student.update_attributes(params[:student])
    75:         flash[:notice] = 'Student was successfully updated.'
    76:         format.html { redirect_to(@student) }
    77:         format.xml  { head :ok }
    78:       else
    79:         format.html { render :action => "edit" }
    80:         format.xml  { render :xml => @student.errors, :status => :unprocessable_entity }
    81:       end
    82:     end
    83:   end

[Validate]