Keine Beschreibung http://j1x-huginn.herokuapp.com

agent_helper.rb 525B

12345678910111213141516171819
  1. module AgentHelper
  2. def agent_show_view(agent)
  3. name = agent.short_type.underscore
  4. if File.exists?(Rails.root.join("app", "views", "agents", "agent_views", name, "_show.html.erb"))
  5. File.join("agents", "agent_views", name, "show")
  6. end
  7. end
  8. def scenario_links(agent)
  9. agent.scenarios.map { |scenario|
  10. link_to(scenario.name, scenario, class: "label", style: style_colors(scenario))
  11. }.join(" ").html_safe
  12. end
  13. def agent_show_class(agent)
  14. agent.short_type.underscore.dasherize
  15. end
  16. end