def index
      # Fix for cancancan not able to merge multiple AR scopes for logged in users
      if can? :manage, Alchemy::Content
        @contents = Content.all
      else
        @contents = Content.accessible_by(current_ability, :index)
      end
      if params[:element_id].present?
        @contents = @contents.where(element_id: params[:element_id])
      end
      render json: @contents, adapter: :json, root: :contents
    end
def index
      # Fix for cancancan not able to merge multiple AR scopes for logged in users
      if can? :manage, Alchemy::Content
        @contents = Content.all
      else
        @contents = Content.accessible_by(current_ability, :index)
      end
      if params[:element_id].present?
        @contents = @contents.where(element_id: params[:element_id])
      end
      render json: @contents, adapter: :json, root: :contents
    end
Returns all contents as json object

 You can either load all or only these for :element_id param