app/controllers/services_controller.rb
# Updates an existing service using info entered on the "edit" page
Updates an existing service using info entered on the "edit" page
Updates an existing service using info entered on the " edit " page
def update
    authorize! :update, @service
    if @service.update_attributes(params[:service])
      flash[:notice] = t(:service) + t(:updated)
    else
      flash[:error] = t(:service) + t(:needs_a_name)
      render :edit
      return
    end
    redirect_to edit_service_path(@service.id) 
  end
def update authorize! :update , @service if @service . update_attributes ( params [ :service ] ) flash [ :notice ] = t ( :service ) + t ( :updated ) else flash [ :error ] = t ( :service ) + t ( :needs_a_name ) render :edit return end redirect_to edit_service_path ( @service . id ) end
Updates an existing service using info entered on the "edit" page
Updates an existing service using info entered on the " edit " page