_comment_form.rhtml

来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· RHTML 代码 · 共 53 行

RHTML
53
字号
<%= form_remote_tag :url      => {:action => 'comment', :id => @article},                    :position => :bottom,                    :update   => {:success => 'commentList'},                    :loading  => "loading()",                    :complete => "complete(request)",                    :failure  => "failure(request)",                    :html     => {:id => 'commentform', :class => 'comments' } %><div id="preview" style="display:none"></div><fieldset>  <legend>Comments</legend>  <p>    <label>Name:<br />      <%= text_field "comment", "author" %>      <small>(<%= link_to_function("leave url/email &#187;", "Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)</small>    </label>  </p>  <div id="extra_fields" style="display:none;">      <p>        <label>Email: <%= content_tag('small', "(#{link_to('gravatar', 'http://gravatar.com')} enabled)") if this_blog.use_gravatar %><br />          <%= text_field "comment", "email" %>        </label>      </p>      <p>        <label>Url:<br />          <%= text_field "comment", "url" %>        </label>      </p>  </div>  <p>    <label>      Comments:      <%= content_tag('small', link_to("Textile enabled", "http://hobix.com/textile/")) if this_blog.comment_text_filter.include? 'textile' %>      <%= content_tag('small', link_to("Markdown enabled", "http://daringfireball.net/projects/markdown/")) if this_blog.comment_text_filter.include? 'markdown' %>      <br />      <%= text_area 'comment', 'body' %>    </label>  </p>  <p>    <%= submit_to_remote('preview', 'Preview!',                         :update => 'preview',                         :complete => "Element.show('preview')",                         :url    => { :action => 'comment_preview' }) %>    <%= submit_tag 'Submit', :id => 'form-submit-button',  :onclick => "$('commentform').onsubmit();this.disabled=true;Element.hide('preview');return false;" %>    <%= image_tag '/images/theme/spinner.gif', :id => 'comment_loading', :style => 'display:none' %>  </p></fieldset><%= end_form_tag %>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?