app/controllers/application_details_controller.rb
# Toggle status of application open/closed based on existence of a file
Toggle status of application open/closed based on existence of a file
Toggle status of application open / closed based on existence of a file
def toggle_application_status
    @application_details = ApplicationDetail.all
    pid_file = "#{Rails.root}/config/app_is_inactive.pid"
    if File.exists? pid_file
      File.delete pid_file
    else
      File.open(pid_file, 'w'){|f| f.write Process.pid}
    end
    respond_with(@application_details, :location => application_details_url) do |format|
      format.js
      format.html { redirect_to application_details_url }
    end
  end
def toggle_application_status @application_details = ApplicationDetail . all pid_file = "#{Rails.root}/config/app_is_inactive.pid" if File . exists? pid_file File . delete pid_file else File . open ( pid_file , 'w' ) { | f | f . write Process . pid } end respond_with ( @application_details , :location => application_details_url ) do | format | format . js format . html { redirect_to application_details_url } end end
Toggle status of application open/closed based on existence of a file
Toggle status of application open / closed based on existence of a file