app/controllers/projects_controller.rb
#
# Creates new project and adds it to database.
#

Creates new project and adds it to database.
Creates new project and adds it to database .
def create
    @project = Project.new(params[:project])
    @project.client_id = params[:project][:client_id]
    @selected['client_id'] = @project.client.id if @project.client
    if @project.save
      flash[:notice] = 'Project has been successfully created'
      redirect_to :action => 'list'
    else
      render :action => 'new'
    end
  end
def create @project = Project . new ( params [ :project ] ) @project . client_id = params [ :project ] [ :client_id ] @selected [ 'client_id' ] = @project . client . id if @project . client if @project . save flash [ :notice ] = 'Project has been successfully created' redirect_to :action => 'list' else render :action => 'new' end end
Creates new project and adds it to database.
Creates new project and adds it to database .