def update
      @element = Element.find(params[:id])

      respond_to do |format|
        if @element.update_attributes(params[:element])
          format.js
        else
          format.js { render :action => 'error.js.erb' }
        end
      end
    end
def update
      @element = Element.find(params[:id])

      respond_to do |format|
        if @element.update_attributes(params[:element])
          format.js
        else
          format.js { render :action => 'error.js.erb' }
        end
      end
    end
PUT /elements/1