app/controllers/materials_controller.rb
# All teaching material ordered by name
All teaching material ordered by name
All teaching material ordered by name
def update
		@material = Material.find(params[:id])
		@courses = Course.order("name ASC").all
		if @material.update(material_params)
			redirect_to @material
		else
			render 'edit'
		end
	end
def update @material = Material . find ( params [ :id ] ) @courses = Course . order ( "name ASC" ) . all if @material . update ( material_params ) redirect_to @material else render 'edit' end end
All teaching material ordered by name
All teaching material ordered by name
# Try to save file in db