def create
if ! request.post?
redirect_to :action => 'list'
return false
end
@proposal = Proposal.new(params[:proposal])
@proposal.transaction do
begin
@proposal.save or
raise ActiveRecord::Rollback, @proposal.errors.full_messages
auth = Authorship.new(:person => @user, :proposal => @proposal)
auth.save or raise ActiveRecord::Rollback, auth.errors.full_messages
rescue ActiveRecord::Rollback => msg
flash[:error] << _('Error saving your proposal: %s') % msg.message
@confs = @user.conferences_for_submitting
render :action => 'new'
return false
end
end
flash[:notice] << _('Your proposal was successfully registered')
redirect_to :action => :show, :id => @proposal.id
end