Files
ubicloud/views/project/create.erb
Jeremy Evans cb389c5144 Use Roda part plugin to simplify render calls with locals
This uses the new part plugin to simplify and optimize render
calls with locals.

```ruby
render(:template, locals: {foo: 'bar'})

part(:template, foo: 'bar')
```

This simplifies a large number of calls in Clover, since
rendering with locals is one of the most common method
calls in the templates.

The main advantage of this is simplicity, but the part method
is also more optimized, and will be even more optimized when
we upgrade to Ruby 3.4.

Diff best reviewed with:

```
git diff -b --color-words --word-diff-regex='\\w+|[^[:space:]]'
```
2025-01-31 09:47:06 -08:00

35 lines
1.1 KiB
Plaintext

<% @page_title = "Create Project" %>
<%== part("components/page_header", breadcrumbs: [%w[Projects /project], %w[Create #]]) %>
<div class="grid gap-6">
<form action="/project" method="POST">
<%== csrf_tag("/project") %>
<!-- Create Card -->
<div class="overflow-hidden rounded-lg shadow ring-1 ring-black ring-opacity-5 bg-white divide-y divide-gray-200">
<div class="px-4 py-5 sm:p-6">
<div class="grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
<div class="sm:col-span-3">
<%== part(
"components/form/text",
name: "name",
label: "Name",
attributes: {
required: true,
placeholder: "Enter name"
}
) %>
</div>
</div>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center justify-end gap-x-6">
<a href="/project" class="text-sm font-semibold leading-6 text-gray-900">Cancel</a>
<%== part("components/form/submit_button", text: "Create") %>
</div>
</div>
</div>
</form>
</div>