app/controllers/services_controller.rb
def create
    authorize! :create, Service
    @service = Service.new(params[:service])
    if @service.save
      flash[:notice] = t(:service) + t(:created)
    else
      flash[:error] = t(:service) + t(:needs_a_name)
    end
    redirect_to services_path  
  end
# Creates a new service using info entered on the "new" page
Creates a new service using info entered on the "new" page
Creates a new service using info entered on the " new " page
def create
    authorize! :create, Service
    @service = Service.new(params[:service])
    if @service.save
      flash[:notice] = t(:service) + t(:created)
    else
      flash[:error] = t(:service) + t(:needs_a_name)
    end
    redirect_to services_path  
  end
def create authorize! :create , Service @service = Service . new ( params [ :service ] ) if @service . save flash [ :notice ] = t ( :service ) + t ( :created ) else flash [ :error ] = t ( :service ) + t ( :needs_a_name ) end redirect_to services_path end
Creates a new service using info entered on the "new" page
Creates a new service using info entered on the " new " page