|
|
|
@ -36,14 +36,19 @@ class HomeworkAttachController < ApplicationController
|
|
|
|
|
@homework.save_attachments(params[:attachments])
|
|
|
|
|
render_attachment_warning_if_needed(@homework)
|
|
|
|
|
|
|
|
|
|
@homework.save
|
|
|
|
|
#@homework.save
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
if @homework.save
|
|
|
|
|
format.html { redirect_to @homework, notice: 'Post was successfully created.' }
|
|
|
|
|
format.json { render json: @homework, status: :created, location: @homework }
|
|
|
|
|
#ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id)
|
|
|
|
|
#format.html { redirect_to project_for_bid_path(:id => @homework.bid), notice: l(:notice_attendingcontest_work_successfully_created) }
|
|
|
|
|
# format.json { render json: @softapplication, status: :created, location: @softapplication }
|
|
|
|
|
flash[:notice] = l(:notice_attendingcontest_work_successfully_created)
|
|
|
|
|
redirect_back_or_default(project_for_bid_path)
|
|
|
|
|
else
|
|
|
|
|
format.js { render status: 406 }
|
|
|
|
|
format.html { render action: "new" }
|
|
|
|
|
format.json { render json: @homework.errors, status: :unprocessable_entity }
|
|
|
|
|
# format.json { render json: @softapplication.errors, status: :unprocessable_entity }
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
#end
|
|
|
|
@ -65,15 +70,10 @@ class HomeworkAttachController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def update
|
|
|
|
|
@homework = HomeworkAttach.find(params[:id])
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
if @homework.update_attributes(params[:homework])
|
|
|
|
|
format.html { redirect_to @homework, notice: 'Homework was successfully updated.' }
|
|
|
|
|
format.json { head :no_content }
|
|
|
|
|
else
|
|
|
|
|
format.html { render action: "edit" }
|
|
|
|
|
format.json { render json: @homework.errors, status: :unprocessable_entity }
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
#@homework.name = params[:name]
|
|
|
|
|
#@homework.name = params[:description]
|
|
|
|
|
#@homework.save
|
|
|
|
|
@homework.update_attribute(params[:homework])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
|