Skip to content

Instantly share code, notes, and snippets.

def rank
Member.where("cached_total > ?", cached_total).count + 1
end
var i = 0;
setTimeout( function() {
$(".rotatorSelector li").progressbar({ value: i });
i = i + 1;
}, 1);
/* markup */
<%= content_for :sidebar do %>
<ul class="sortable">
<% @page_parts.each do |f| %>
<li id="menu_<%= f.id %>"><%= f.title %></li>
<% end %>
</ul>
<% end %>
$("#header").hoverIntent({
over: makeTall,
timeout: 500,
out: makeShort
});
function makeTall(){
$(this).animate({"height":140},200);
$('#main').animate({"margin-top":140},200);
$('.nav').fadeIn();
}
config.model PagePart do
edit do
field :content, :text do
ckeditor do
true
end
end
end
end
Rails.application.routes.draw do
match '/blog' => 'cms#blog'
match '/blog/:id' => 'cms#post'
match '/categories/:id' => 'cms#category'
match '/tags/:id' => 'cms#tag'
match '/:id' => 'cms#page'
end
#routes.rb
Rails.application.routes.draw do
match '/blog' => 'cms#blog'
match '/blog/:id' => 'cms#post'
match '/categories/:id' => 'cms#category'
match '/tags/:id' => 'cms#tag'
match '/:id' => 'cms#page'
end
#cms_controller.rb
var rotation = function (){
$("#img").rotate({
angle:0,
animateTo:360,
callback: rotation,
easing: function (x,t,b,c,d){ // t: current time, b: begInnIng value, c: change In value, d: duration
return c*(t/d)+b;
}
});
}
$(document).ready(function(){
$(".videoBG").append($('.wheel'));
$(".wheel").animate({
top: '10%',
}, 3500, function() {
$(".wheel").rotate({
animateTo:720,
callback: function(){
$(".wheel").animate({
top: '0%',
#FORM
%fieldset#organization{:style => "display:none"}
%h3
Organization
= f.fields_for :organisations do |org|
.row
.span5
= org.input :name, :label => "<strong>Name of the Organization</strong>"
.span5
//= org.input :title, :label => "Your role"