This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#contentButton{ :class => cycle('first ','second ','third ') + blurb.id.to_s } | |
= image_tag('ancillary/ribbon_top.png', :class => 'ribbonTop') | |
= image_tag('ancillary/ribbon_bottom.png', :class => 'ribbonBot') | |
= image_tag blurb.image.url, :class => "blurbImage" unless blurb.image.blank? | |
%p.heading= blurb.name | |
%p.shortContent= blurb.short_content.presence || nil | |
.contents= blurb.content | |
#contentRow <-- This element should only be rendered if this is the 3rd render loop or if it is the last render loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#contentButton{ :class => cycle_with_last(blurb, @content, options = {:one => 'first ', :two => 'second ', :three => 'third ', :last => 'last '}) + blurb.id.to_s } | |
= image_tag('ancillary/ribbon_top.png', :class => 'ribbonTop') | |
= image_tag('ancillary/ribbon_bottom.png', :class => 'ribbonBot') | |
= image_tag blurb.image.url, :class => "blurbImage" unless blurb.image.blank? | |
%p.heading= blurb.name | |
%p.shortContent= blurb.short_content.presence || nil | |
.contents= blurb.content | |
= add_row_on_last(blurb, @content) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validate :is_valid_time | |
def valid_time? | |
self.time > 24.hours.from_now | |
end | |
def is_valid_time | |
errors.add("Your object", "is not valid. Other explainations.") unless valid_time? | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($('div.contentRow').has('#calendar').not('.fc')) { | |
doCalendar(); | |
console.log('it does'); | |
console.log($('div.contentRow').children()) | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($(".contentRow .contents #calendar:not('.fc')").length > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventsController < InheritedResources::Base | |
respond_to :json, :only => :index | |
def index | |
@events = Event.all | |
respond_with(@events, :only => [:id, :title, :start]) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for(:javascript) do %> | |
locations = []; | |
<% @locations.each do |loc|%> | |
locations.push(new google.maps.LatLng(<%=loc.lat%>, <%=loc.lon%>)); | |
<%end%> | |
<%end%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contactu | |
include ActiveModel::Validations | |
validates_presence_of :email, :name, :phone, :message | |
attr_accessor :id, :email, :phone, :name, :message | |
def initialize(attributes = {}) | |
attributes.each do |key, value| | |
self.send("#{key}=", value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@supervisor = User.find(1) | |
@staff = User.find(2) | |
@supervisor.relationships.build(:staff_id => @staff.id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rescue_404 | |
render :file => "#{Rails.root}/public/404.html", | |
:status => 404, :layout => 'application' | |
end |