diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 87879f24..a90ca1d1 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -805,6 +805,7 @@ class BidsController < ApplicationController @homework = @bid @course = Course.find_by_id(params[:course_id]) @course_id = @course.id + render file: 'courses/new_homework', layout: 'base_courses' end end diff --git a/app/models/attachment.rb b/app/models/attachment.rb index fe3ff841..94f8f7c9 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -129,7 +129,7 @@ class Attachment < ActiveRecord::Base nil end - def filename=(arg) + def filename=(arg) write_attribute :filename, sanitize_filename(arg.to_s) filename end diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb index e1fd553b..ec25cef0 100644 --- a/app/views/courses/new_homework.html.erb +++ b/app/views/courses/new_homework.html.erb @@ -1,6 +1,6 @@

<%=l(:label_course_new_homework)%>

-<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework'} do |f| %> +<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id=>@course.id} do |f| %>
<%= render :partial => 'homework_form', :locals => { :f => f } %> <%= submit_tag l(:button_create), :class => "enterprise" %>