app/controllers/materials_controller.rb
# All teaching material ordered by name
All teaching material ordered by name
All teaching material ordered by name
def create
		@material = Material.new(material_params)  
		@courses = Course.order("name ASC").all
		if @material.save
			redirect_to @material
		else
			render 'new'
		end
	end
def create @material = Material . new ( material_params ) @courses = Course . order ( "name ASC" ) . all if @material . save redirect_to @material else render 'new' end end
All teaching material ordered by name
All teaching material ordered by name
# Try to save file in db