logs_controller.rb 321B

1234567891011121314151617181920
  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.logs.delete_all
  9. index
  10. end
  11. protected
  12. def load_agent
  13. @agent = current_user.agents.find(params[:agent_id])
  14. end
  15. end