adopt-a-hydrant/app/views/main/_adoption_form.html.erb

12 lines
648 B
Plaintext

<% style = user_signed_in? ? {} : {:style => "display: none;"}%>
<%= form_for hydrant, :remote => true, :html => {:class => "adoption_form"}.merge(style) do |f| %>
<div id="adoption_fields">
<%= f.hidden_field "id" %>
<%= f.hidden_field "user_id", :value => (user_signed_in? ? current_user.id : nil) %>
<%= f.label "name", "Give your hydrant a name", :id => "hydrant_name_label" %>
<%= f.text_field "name", :tabindex => 1 %>
<%= f.submit "Adopt!", :tabindex => 2, :id => "adoption_form_submit" %>
<p>By adopting this hydrant, you agree to the <%= link_to "Terms of Service", "#", :tabindex => 3 %>.</p>
</div>
<% end %>