app/controllers/studentships_controller.rb
def create
    @studentship = Studentship.new(studentship_params)

     @studentship.status = 1
#not inrelvant any more
    if @studentship.fire== true 
     #add date to calander with the id
     @studentship.firestatus = false
    else
     @studentship.firestatus = true 
  
     @studentship.fdate = ""

    end 
   
    if @studentship.screenttest== true 
     @studentship.screenstatus =false
    else
      @studentship.screenstatus = true 
  @studentship.sdate = ""
  

    end 
    if @studentship.training == true
     @studentship.trainstatus = false
    else
      @studentship.trainstatus = true 
     @studentship.tdate = ""  
  

    end 
   
    if @studentship.m12  == true
    else 
     @studentship.m12date = ""  
    end 

    if @studentship.m24  == true
    else 
     @studentship.m24date = ""  
    end
 
    if @studentship.m36  == true
    else 
     @studentship.m36date = ""  
    end
    @studentship.archive = false 
    if @studentship.save
     id =  createprojectid(@studentship)
     redirect_to tasks_path(:project_id => id ), notice: 'Studentship was successfully created.'
    else
     render action: 'new'
    end
  end
# POST /studentships
#when calander is installed remeber to add the dats the calander table
POST /studentships
when calander is installed remeber to add the dats the calander table
POST / studentships when calander is installed remeber to add the dats the calander table
def create
    @studentship = Studentship.new(studentship_params)
     @studentship.status = 1
    if @studentship.fire== true 
     @studentship.firestatus = false
    else
     @studentship.firestatus = true 
     @studentship.fdate = ""
    end 
    if @studentship.screenttest== true 
     @studentship.screenstatus =false
    else
      @studentship.screenstatus = true 
  @studentship.sdate = ""
    end 
    if @studentship.training == true
     @studentship.trainstatus = false
    else
      @studentship.trainstatus = true 
     @studentship.tdate = ""  
    end 
    if @studentship.m12  == true
    else 
     @studentship.m12date = ""  
    end 
    if @studentship.m24  == true
    else 
     @studentship.m24date = ""  
    end
    if @studentship.m36  == true
    else 
     @studentship.m36date = ""  
    end
    @studentship.archive = false 
    if @studentship.save
     id =  createprojectid(@studentship)
     redirect_to tasks_path(:project_id => id ), notice: 'Studentship was successfully created.'
    else
     render action: 'new'
    end
  end
def create @studentship = Studentship . new ( studentship_params ) @studentship . status = 1 if @studentship . fire == true @studentship . firestatus = false else @studentship . firestatus = true @studentship . fdate = "" end if @studentship . screenttest == true @studentship . screenstatus = false else @studentship . screenstatus = true @studentship . sdate = "" end if @studentship . training == true @studentship . trainstatus = false else @studentship . trainstatus = true @studentship . tdate = "" end if @studentship . m12 == true else @studentship . m12date = "" end if @studentship . m24 == true else @studentship . m24date = "" end if @studentship . m36 == true else @studentship . m36date = "" end @studentship . archive = false if @studentship . save id = createprojectid ( @studentship ) redirect_to tasks_path ( :project_id => id ) , notice : 'Studentship was successfully created.' else render action : 'new' end end
POST /studentships
when calander is installed remeber to add the dats the calander table
POST / studentships when calander is installed remeber to add the dats the calander table
#not inrelvant any more #add date to calander with the id