Skip to content

Instantly share code, notes, and snippets.

Time::DATE_FORMATS[:default] = "%Y-%m-%d %I:%M %p"
Time::DATE_FORMATS[:time] = "%l:%M:%S %p"
<table id="participation-table">
...
...
...
<tr>
<td>
<% if (participation.comment.length > 75) %>
<span class="truncated"><%= truncate(participation.comment, length: 75, separator: ' ') %></span>
<span class="full"><%= participation.comment %></span>
<%= link_to 'View more', '#', class: "view-more" %>
#tags-drop {
color: #555;
}
#tags-drop ul {
display: none;
position: absolute;
background-color: white;
border: 1px solid silver;
}
#tags-drop:hover ul {
<body>
<div id="wrapper">
<div id="header">
<div id="access">
<div class="menu">
<div id="pages">
<ul>
<li><a href="/">Home</a></li>
Code goes here!
<ul>
<li><a href="/">Home</a></li>
<li id="tags-drop">TAGS
<ul>
<li><a href="/tagged/rails">Rails</a></li>
<li><a href="/tagged/javascript">JavaScript</a></li>
<li><a href="/tagged/technology">Technology</a></li>
<li><a href="/tagged/life">Life</a></li>
</ul>
</li>
@hansonwu
hansonwu / button_to
Created February 27, 2012 01:45
button_to
<%= button_to I18n.t(:delete),
assignment_rubrics_path(:id => criterion.id),
:confirm => I18n.t(:remove_criteria_message),
:method => 'delete',
:class => 'delete',
:title => I18n.t(:remove_criteria_title),
:remote => true %>
@hansonwu
hansonwu / link_to_remote - link_to not working
Created February 14, 2012 06:16
link_to_remote -> link_to not working