journalduhacker/app/views/stories/_commentbox.html.erb
2012-06-16 20:15:46 -05:00

24 lines
686 B
Plaintext

<%= form_tag({ :controller => "comments", :action => "create",
:story_id => story.short_id }, :method => :post) do |f| %>
<%= text_area_tag "comment", comment.comment, :size => "100x5" %>
<p></p>
<%= button_to_function "Post Comment",
"Lobsters.postComment($(this).parents('form').first()); return false;",
:type => "submit" %>
&nbsp;
<%= button_to_function "Preview Comment",
"Lobsters.previewComment($(this).parents('form').first()); return false;"
%>
<% if params[:preview].present? %>
<ol class="comments">
<%= render :partial => "stories/comment",
:locals => { :comment => comment, :story => story } %>
</ol>
<% end %>
<% end %>