Skip to content

Instantly share code, notes, and snippets.

View raderj89's full-sized avatar

Jared Rader raderj89

View GitHub Profile
@raderj89
raderj89 / add_or_remove.html.erb
Last active December 30, 2015 02:39
add and remove collaborators solution
<!-- wiki_collaborations/add_or_remove.html.erb -->
<!-- how can this be cleaned up? -->
<div class="row">
<div class="col-sm-6">
<%= form_for wiki, url: wiki_collaborations_path, method: :post do %>
<%= hidden_field_tag :wiki_id, wiki.id %>
<% @users.each do |user| %>
<% next if current_user == user %>
<div class="checkbox">
@raderj89
raderj89 / _posts.html.erb
Last active December 28, 2015 05:19
Trying to implement infinite scroll on Bloccit.
<% @posts.each do |post| %>
<div class="media">
<%= render partial: 'votes/voter', locals: { topic: @topic, post: post } %>
<div class="media-body">
<h4 class="media-heading">
<%= link_to (markdown post.title), [@topic, post] %>
<%= image_tag(post.image.thumb.url) if post.image? %>
<br>
<small>
<%= image_tag(post.user.avatar.tiny.url) if post.user.avatar? %>
class Shape
attr_accessor :color
def can_fit?(shape)
area > shape.area
end
end
class Rectangle < Shape
attr_accessor :width, :height