I'm giving Draper a try as an alternative to helpers. I get the cases where I am just formatting the information. But what about interacting with the Rails form builder. For example if I wanted to output a string or a select box depending on some context. Do I pass the form builder as an argument. So in my decorator:
def role_or_select form
available_roles = h.policy_scope User::ROLES
if available_roles.include? role
form.input :role, collection: available_roles, include_blank: false
else
role
end
end
Then in my view:
= simple_form_for user do |form|
...
= user.role_or_select_on form
...
Is there a more elegant method?