Files
ubicloud/views/components/form/textarea.erb
Jeremy Evans 65e935d3d7 Make name and label required keyword arguments to textarea component
All callers already set these keywords, and a nil name would result
in an exception in the typecast_params code.
2025-08-08 01:52:14 +09:00

16 lines
754 B
Plaintext

<%# locals: (name:, value: nil, label:, description: nil, attributes: {}) %>
<% value = flash.dig("old", name) || typecast_body_params.str(name) || value %>
<div class="space-y-2">
<label for="<%= name %>" class="block text-sm font-medium leading-6 text-gray-900"><%= label %></label>
<textarea
id="<%= name %>"
name="<%= name %>"
class="block w-full rounded-md border-0 py-1.5 shadow-sm ring-1 ring-inset focus:ring-2 focus:ring-inset text-sm sm:leading-6 text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-orange-600"
<%== html_attrs(attributes) %>
><%= value %></textarea>
<% if description %>
<p class="text-sm text-gray-500 leading-6" id="<%= name %>-description"><%= description %></p>
<% end %>
</div>