Module: Fosm::ApplicationHelper
- Included in:
- Rails::ApplicationHelper
- Defined in:
- app/helpers/fosm/application_helper.rb
Instance Method Summary collapse
-
#fosm_actor_label(transition) ⇒ Object
Returns a human-friendly label for an actor stored in a TransitionLog.
-
#fosm_state_badge(state) ⇒ Object
Returns a human-friendly label for a FOSM state, suitable for display in views.
Instance Method Details
#fosm_actor_label(transition) ⇒ Object
Returns a human-friendly label for an actor stored in a TransitionLog.
10 11 12 13 14 15 16 17 |
# File 'app/helpers/fosm/application_helper.rb', line 10 def fosm_actor_label(transition) if transition.by_agent? content_tag(:span, "AI Agent", class: "text-xs font-medium text-purple-600 bg-purple-50 px-2 py-0.5 rounded") else transition.actor_label || transition.actor_type || "—" end end |
#fosm_state_badge(state) ⇒ Object
Returns a human-friendly label for a FOSM state, suitable for display in views.
4 5 6 7 |
# File 'app/helpers/fosm/application_helper.rb', line 4 def fosm_state_badge(state) content_tag(:span, state.to_s.humanize, class: "text-xs font-medium px-2 py-0.5 rounded bg-gray-100 text-gray-700") end |