Class/Module Index [+]

Quicksearch

LecturersController

Public Instance Methods

create() click to toggle source

POST /lecturers POST /lecturers.json

# File app/controllers/lecturers_controller.rb, line 43
def create
  @lecturer = Lecturer.new(params[:lecturer])

  respond_to do |format|
    if @lecturer.save
      format.html { redirect_to @lecturer, notice: 'Lecturer was successfully created.' }
      format.json { render json: @lecturer, status: :created, location: @lecturer }
    else
      format.html { render action: "new" }
      format.json { render json: @lecturer.errors, status: :unprocessable_entity }
    end
  end
end
destroy() click to toggle source

DELETE /lecturers/1 DELETE /lecturers/1.json

# File app/controllers/lecturers_controller.rb, line 75
def destroy
  @lecturer = Lecturer.find(params[:id])
  @lecturer.destroy

  respond_to do |format|
    format.html { redirect_to lecturers_url }
    format.json { head :no_content }
  end
end
edit() click to toggle source

GET /lecturers/1/edit

# File app/controllers/lecturers_controller.rb, line 37
def edit
  @lecturer = Lecturer.find(params[:id])
end
index() click to toggle source
# File app/controllers/lecturers_controller.rb, line 5
def index
  @lecturers = Lecturer.all

  respond_to do |format|
    format.html # index.html.erb
    format.json { render json: @lecturers }
  end
end
new() click to toggle source

GET /lecturers/new GET /lecturers/new.json

# File app/controllers/lecturers_controller.rb, line 27
def new
  @lecturer = Lecturer.new

  respond_to do |format|
    format.html # new.html.erb
    format.json { render json: @lecturer }
  end
end
show() click to toggle source

GET /lecturers/1 GET /lecturers/1.json

# File app/controllers/lecturers_controller.rb, line 16
def show
  @lecturer = Lecturer.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @lecturer }
  end
end
update() click to toggle source

PUT /lecturers/1 PUT /lecturers/1.json

# File app/controllers/lecturers_controller.rb, line 59
def update
  @lecturer = Lecturer.find(params[:id])

  respond_to do |format|
    if @lecturer.update_attributes(params[:lecturer])
      format.html { redirect_to @lecturer, notice: 'Lecturer was successfully updated.' }
      format.json { head :no_content }
    else
      format.html { render action: "edit" }
      format.json { render json: @lecturer.errors, status: :unprocessable_entity }
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.