def create
      # TODO do this within the Rails framework
      # @element = params[:element_type].constantize.new(params[:element])

      @element = "Qe::#{params[:element_type]}".constantize.new(params[:element])
      @element.required = true if @element.question?
      @question_sheet = @page.question_sheet
      respond_to do |format|
        # TODO engineer the mass assignment flow of the engine
        if @element.save!(:without_protection => true)
          @page_element = PageElement.create(:element => @element, :page => @page)
          format.js
        else
          format.js { render :action => 'error.js.erb' }
        end
      end
    end
def create
      # TODO do this within the Rails framework
      # @element = params[:element_type].constantize.new(params[:element])

      @element = "Qe::#{params[:element_type]}".constantize.new(params[:element])
      @element.required = true if @element.question?
      @question_sheet = @page.question_sheet
      respond_to do |format|
        # TODO engineer the mass assignment flow of the engine
        if @element.save!(:without_protection => true)
          @page_element = PageElement.create(:element => @element, :page => @page)
          format.js
        else
          format.js { render :action => 'error.js.erb' }
        end
      end
    end
POST /elements