My Recent Pastes (39 and counting)
All Pasties (over 39 and counting)
Below are summaries of the 9 most recent pasties by Duane Johnson.
August 26, 2007
11:51PM EDT
by Duane Johnson
View more (6 lines)
1 2 3 4 5 |
desc "Run a specific spec with TASK=xxxx"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_opts = ["--format", "specdoc", "--colour"]
t.libs = ['lib', 'server/lib' ]
t.spec_files = ["specs/merb/merb_#{ENV['TASK']}_spec.rb"]
|
August 04, 2007
5:53PM EDT
by Duane Johnson
View more (13 lines)
1 2 3 4 5 |
Merb::Router.prepare do |r| # restfull routes # r.resources :posts r.add '/admin/users/:action/:id', :controller => 'admin/users', :action => 'index', :id => nil |
November 15, 2006
12:14PM EDT
by Duane Johnson
1 2 3 |
<script type="text/javascript" charset="utf-8"> window.location = "<%= publish_url(:action => "approve") %>"; </script> |
November 14, 2006
8:07PM EDT
by Duane Johnson
View more (96 lines)
1 2 3 4 5 |
def new
@photo = Photo.new(params[:photo])
end
# Create a new Photo. e.g. [POST] /gallery/photos
|
November 14, 2006
8:05PM EDT
by Duane Johnson
View more (16 lines)
1 2 3 4 5 |
['new_photo', 'edit_photo', 'photo', 'photos'].each do |prefix|
define_method "#{prefix}_url" do |options|
options ||= {}
if params[:content_id]
options.merge! :content_id => params[:content_id]
|
November 14, 2006
8:02PM EDT
by Duane Johnson
View more (16 lines)
1 2 3 4 5 |
# RESTful resources map.resources :sales, :controller => "sales/imemorybook", :path_prefix => "" map.resources :books, :controller => "bookshelf/books", :path_prefix => "/bookshelf" map.resources :pages, :controller => "bookshelf/pages", :path_prefix => "/bookshelf" map.resources :sections, :controller => "bookshelf/sections", :path_prefix => "/bookshelf" |
November 13, 2006
3:56PM EDT
by Duane Johnson
View more (65 lines)
1 2 3 4 5 |
# Basically, I just need the following code integrated so that we can optionally pass RakeMate # some parameters (rather than calling it directly and assuming that the current file is active) # # It would also be nice if we could use my method of inheriting the PATH from the environment so # that Rails users wouldn't have to set TM_RAKE. |
November 08, 2006
6:10PM EDT
by Duane Johnson
1 2 |
file.puts "\\setupindenting[#{@book.style.paragraph_indenting+(@book.style.paragraph_indenting=='none'?'':',first')}]"
file.puts "\\setupwhitespace[#{@book.style.paragraph_spacing}]"
|
October 31, 2006
7:34PM EDT
by Duane Johnson
1 2 3 |
<% content_for :left do %> <%= render :partial => 'side_menu' %> <% end %> |
Pastie