carpeliam (owner)

Revisions

gist: 38599 Download_button fork
public
Public Clone URL: git://gist.github.com/38599.git
Embed All Files: show embed
feather.rb #
1
2
3
4
5
6
7
      # having .to() allows this to not die when running 'slice' from cmd line
      scope.match("/:permalink").to(:controller => "articles").defer_to do |request, params|
        unless (article = Feather::Article.find_by_permalink(params[:permalink])).nil?
          {:controller => "articles", :action => "show", :id => article.id}
        end
      end
 
router.rb #
1
2
3
4
5
6
  match("/:permalink").defer_to do |request, params|
    unless (article = Feather::Article.find_by_permalink(params[:permalink])).nil?
      {:controller => "feather/articles", :action => "show", :id => article.id}
    end
  end