refactored dtext field helper

This commit is contained in:
albert
2011-10-21 17:45:49 -04:00
parent e8ac9cfcc1
commit 0eb665af0d
11 changed files with 38 additions and 41 deletions

View File

@@ -3,9 +3,9 @@
<h1>Edit Comment</h1>
<%= simple_form_for(@comment) do |f| %>
<%= render "dtext/form", :name => "Body", :input_id => "comment_body", :input_name => "comment[body]", :value => @comment.body, :preview_id => "dtext-preview" %>
<%= dtext_field "comment", "body" %>
<%= f.button :submit, "Submit" %>
<%= f.button :submit, "Preview", "data-input-id" => "comment_body", "data-preview-id" => "dtext-preview" %>
<%= dtext_preview_button "comment", "body" %>
<% end %>
</div>
</div>

View File

@@ -3,7 +3,7 @@
<%= form_tag(comments_path, :class => "simple_form") do %>
<%= hidden_field "comment", "post_id", :value => post.id %>
<%= render "dtext/form", :name => "Response", :input_id => "comment_response_for_#{post.id}", :input_name => "comment[body]", :value => "", :preview_id => "dtext-preview-for-#{post.id}" %>
<%= dtext_field "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
<%= submit_tag "Post" %>
<%= submit_tag "Preview", "data-input-id" => "comment_response_for_#{post.id}", "data-preview-id" => "dtext-preview-for-#{post.id}" %>
<%= dtext_preview_button "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
<% end %>