Sha256: 025216aa9a6e50ce9040d3820d223ed05e9c15cdce7ab573a661e9d75c3aaf2c

Contents?: true

Size: 950 Bytes

Versions: 4

Compression:

Stored size: 950 Bytes

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class ListsController < ApplicationController

  # POST /lists
  #----------------------------------------------------------------------------
  def create
    # Find any existing list with the same name (case insensitive)
    if @list = List.find(:first, :conditions => ["lower(name) = ?", params[:list][:name].downcase])
      @list.update_attributes(params[:list])
    else
      @list = List.create(params[:list])
    end

    respond_with(@list)
  end

  # DELETE /lists/1
  #----------------------------------------------------------------------------
  def destroy
    @list = List.find(params[:id])
    @list.destroy

    respond_with(@list)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 app/controllers/lists_controller.rb
fat_free_crm-0.12.2 app/controllers/lists_controller.rb
fat_free_crm-0.12.1 app/controllers/lists_controller.rb
fat_free_crm-0.12.0 app/controllers/lists_controller.rb