app/controllers/projects_controller.rb
# index, new and edit actions are handled by load_and_authorize_resource
index, new and edit actions are handled by load_and_authorize_resource
index new and edit actions are handled by load_and_authorize_resource
def create
    if @project.save
      flash[:success] = 'Project was saved!'
      redirect_to root_path
    else
      render 'new'
    end
  end
def create if @project . save flash [ :success ] = 'Project was saved!' redirect_to root_path else render 'new' end end
index, new and edit actions are handled by load_and_authorize_resource
index new and edit actions are handled by load_and_authorize_resource
# load_and_authorize_resource does this behind the scenes: #     @project = Project.new(project_params)