web/mooctracker_rails/app/controllers/projects_controller.rb
#On POST request to /projects it creates a project with sent data
On POST request to /projects it creates a project with sent data
On POST request to / projects it creates a project with sent data
def create
  	@project = current_user.projects.build(project_params)
    if @project.save
      flash[:success] = "project created!"
      render json: @project
    else
      @project_items = []
      render 'static_pages/home'
    end
  end
def create @project = current_user . projects . build ( project_params ) if @project . save flash [ :success ] = "project created!" render json : @project else @project_items = [ ] render 'static_pages/home' end end
On POST request to /projects it creates a project with sent data
On POST request to / projects it creates a project with sent data