logs_controller.rb 318 B

12345678910111213141516171819
  1. class LogsController < ApplicationController
  2. before_filter :load_agent
  3. def index
  4. @logs = @agent.logs.all
  5. render :action => :index, :layout => false
  6. end
  7. def clear
  8. @agent.delete_logs!
  9. index
  10. end
  11. protected
  12. def load_agent
  13. @agent = current_user.agents.find(params[:agent_id])
  14. end
  15. end