def move
      @element = Humpyard::Element.find(params[:id])
      
      if @element
        unless can? :update, @element
          render :json => {
            :status => :failed
          }, :status => 403
          return
        end
        
        @element.update_attributes(
          :container => Humpyard::Element.find_by_id(params[:container_id]), 
          :page_yield_name => params[:yield_name]
        )
        @prev = Humpyard::Element.find_by_id(params[:prev_id])
        @next = Humpyard::Element.find_by_id(params[:next_id])
        
        do_move(@element, @prev, @next)
        
        render :json => {
          :status => :ok
        }
      else
        render :json => {
          :status => :failed
        }, :status => 404        
      end
    end
def move
      @element = Humpyard::Element.find(params[:id])
      
      if @element
        unless can? :update, @element
          render :json => {
            :status => :failed
          }, :status => 403
          return
        end
        
        @element.update_attributes(
          :container => Humpyard::Element.find_by_id(params[:container_id]), 
          :page_yield_name => params[:yield_name]
        )
        @prev = Humpyard::Element.find_by_id(params[:prev_id])
        @next = Humpyard::Element.find_by_id(params[:next_id])
        
        do_move(@element, @prev, @next)
        
        render :json => {
          :status => :ok
        }
      else
        render :json => {
          :status => :failed
        }, :status => 404        
      end
    end
Move an element