This file contains 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
<div class='field'> | |
<%= f.label :image -%> | |
<%= render :partial => "/shared/admin/image_picker", :locals => { | |
:f => f, | |
:field => :image_id, | |
:image => @blog_post.image, | |
:toggle_image_display => false | |
} %> | |
</div> |
This file contains 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
sections = [{:yield => :body_content_top, :fallback => nil}, | |
{:yield => :body_content_title, :fallback => page_title, :title => true}] |
This file contains 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 Comic < ActiveRecord::Base | |
default_scope :order => 'position ASC' | |
has_many :comic_pages | |
def min_comic_position | |
(comics.last.try(:position) || -1) + 1 | |
end | |
acts_as_indexed :fields => [:title, :body] |
This file contains 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
project_type = :rails | |
project_path = Compass::AppIntegration::Rails.root | |
environment = Compass::AppIntegration::Rails.env | |
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets")) | |
Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static', | |
:urls => ['/stylesheets'], | |
:root => "#{Rails.root}/tmp") | |
http_path = '/' |
This file contains 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
ERROR ArgumentError: wrong number of arguments (0 for 1) | |
/Users/joe/.rvm/gems/ruby-1.9.2-head@refinery/gems/railties-3.0.7/lib/rails/application.rb:167:in `call' | |
/Users/joe/.rvm/gems/ruby-1.9.2-head@refinery/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing' | |
(eval):3:in `method_missing' | |
/Users/joe/.rvm/gems/ruby-1.9.2-head@refinery/gems/railties-3.0.7/lib/rails/rack/log_tailer.rb:14:in `call' | |
/Users/joe/.rvm/gems/ruby-1.9.2-head@refinery/gems/rack-1.2.2/lib/rack/content_length.rb:13:in `call' | |
/Users/joe/.rvm/gems/ruby-1.9.2-head@refinery/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in `service' | |
/Users/joe/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service' | |
/Users/joe/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' | |
/Users/joe/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' |
This file contains 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 Example < ActiveRecord::Base | |
#... | |
# would this be cool to have, or am I daft? | |
def has? *args | |
args.any? { |a| send(a.to_sym) } | |
end | |
# irc chan said to drop the to_sym but I like having the failsafe |
This file contains 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
source 'http://rubygems.org' | |
gem 'rails', '3.0.8' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
gem 'refinerycms-calendar' |
This file contains 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
update: function(event, ui) { | |
$('.odd, .even').removeClass('odd even'); | |
$('.item').each(function(index) { | |
index += 1; | |
if (index % 2 === 0) { | |
$(this).addClass('even'); | |
} | |
if (index % 2 !== 0) { | |
return $(this).addClass('odd'); | |
} |