def new
      @element = Humpyard::config.element_types[params[:type]].new(
        :page_id => params[:page_id], 
        :container_id => params[:container_id].to_i > 0 ? params[:container_id].to_i : nil,
        :page_yield_name => params[:yield_name].blank? ? 'main' : params[:yield_name],
        :shared_state => 0)
      
      authorize! :create, @element.element 
      
      @element_type = params[:type]
      @prev = Humpyard::Element.find_by_id(params[:prev_id])
      @next = Humpyard::Element.find_by_id(params[:next_id])
      
      render :partial => 'edit'
    end
def new
      @element = Humpyard::config.element_types[params[:type]].new(
        :page_id => params[:page_id], 
        :container_id => params[:container_id].to_i > 0 ? params[:container_id].to_i : nil,
        :page_yield_name => params[:yield_name].blank? ? 'main' : params[:yield_name],
        :shared_state => 0)
      
      authorize! :create, @element.element 
      
      @element_type = params[:type]
      @prev = Humpyard::Element.find_by_id(params[:prev_id])
      @next = Humpyard::Element.find_by_id(params[:next_id])
      
      render :partial => 'edit'
    end
Dialog content for a new element