Skip to content

Instantly share code, notes, and snippets.

@jkovar
jkovar / _reply.html.erb
Last active June 27, 2016 08:18
acts_as_commentable_with_threading setup
<% comments.each do |comment| %>
<div class="comments-show">
<div class="comment">
<p><%= comment.user.full_name %> <em>(<%= timeago_tag comment.created_at, limit: 5.years.ago %>)</em></p>
<p><%= comment.body %></p>
<div class="comment-nav"><span class="comment-reply">reply</span></div>
<div class="reply-form">
<%= form_for @new_comment do |f| %>
<%= f.hidden_field :commentable_id, value: @new_comment.commentable_id %>
<%= f.hidden_field :commentable_type, value: @new_comment.commentable_type %>
@jkovar
jkovar / gist:4508830
Last active December 10, 2015 23:19
run 'rm public/index.html'
# RVM
file '.rvmrc', "rvm 1.9.2@#{app_name} --create"
# Setup database
gsub_file 'config/database.yml', /username: (.*)/, 'host: localhost'
gsub_file 'config/database.yml', /password:/, ''
# Gems