/
_form.html.erb
21 lines (18 loc) · 1.04 KB
/
_form.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<% remote_form_for :comment, @comment , :url => saveComment_path( :path => params[:path]) do |f| -%>
<%= label :comment, :author, "Your name:" %> <%= f.text_field :author %>
<%= error_message_on :comment, :author %>
<%= label :comment, :author_mail , "Your mail address:" %>
<%= f.text_field :author_mail %>
<div class="hint">(you can also use <strong>name at domain dot com</strong>)</div>
<%= error_message_on :comment, :author_mail %>
<%= label :comment, :content, "Your comment:" %> <%= f.text_area :content %>
<%= error_message_on :comment, :content %>
<% fields_for @captcha do |captcha_fields| -%>
<%= captcha_fields.label :actualValue, "Are you human? Please type #{@captcha.value}" %>
<%= captcha_fields.text_field :actualValue %>
<%= error_message_on @captcha, :value %>
<% end -%>
<br />
<%= submit_tag "Send comment" , :class => "button" %>
<% end -%>
<script>if ($('comment_author').value == '') { $('comment_author').focus() } else { $('comment_content').focus() }</script>