Made the new deliverable form to submit via Ajax

* Added DeliverablesController#create
* Refactored each deliverable row to a partial
* Added RJS to update the page after a submission

  #1135
This commit is contained in:
Eric Davis
2008-05-20 20:58:35 -07:00
parent d1418c25d3
commit b2ecaca21e
6 changed files with 51 additions and 12 deletions
@@ -30,6 +30,22 @@ class DeliverablesController < ApplicationController
render :partial => 'common/preview'
end
def create
@deliverable = Deliverable.new(params[:deliverable])
@deliverable.project = @project
respond_to do |format|
if @deliverable.save
@flash = l(:notice_successful_create)
format.html { redirect_to :action => 'index' }
format.js { render :action => 'create.js.rjs'}
else
# TODO: Failed save
end
end
end
private
def find_project
@project = Project.find(params[:id])