gist: 1464 Download_button fork
public
Public Clone URL: git://gist.github.com/1464.git
default_resource.rb
1
2
3
4
5
6
7
8
9
10
11
12
class Default
  def add ; action( :create ) and redirect( paths.show ) ; end
  def update
    action( :update, name ) and redirect( resource( :site ).paths.main )
  end
  def delete
    action( :delete, name ) and redirect( resource( :site ).paths.main )
  end
  def edit ; action( :find, name ) and render( :editor ) } ; end
  def show ; action( :find, name ) and render( :show ) ; end
end
with_resource.rb
1
2
3
4
5
6
7
      # add a new content object
      map :add, :post => [ 'admin', :resource => /#{resource}/ ]
      map :update, :post => [ 'admin', :resource => /#{resource}/, :name ]
      map :delete, :delete => [ 'admin', :resource => /#{resource}/, :name ]
      map :edit, :get => [ 'admin', :resource => /#{resource}/, :name ]
      map :show, :get => [ :resource, :name ]

Owner

dyoder

Revisions