Created
August 6, 2009 16:19
-
-
Save hallison/163401 to your computer and use it in GitHub Desktop.
Revisions
-
hallison revised this gist
Sep 18, 2009 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,6 @@ require 'rubygems' require 'sinatra' require 'sinatra/mapping' require 'blogware' run Sinatra::Application -
hallison revised this gist
Sep 18, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,6 @@ require 'rubygems' require 'sinatra' require 'sinatra/mapping' require 'blogware' run Sinatra::Application -
hallison revised this gist
Sep 18, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,6 @@ require 'rubygems' require 'sinatra' require 'sinatra/mapping' require 'blogware' # this source is blogware.rb run Sinatra::Application -
hallison renamed this gist
Sep 18, 2009 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
hallison revised this gist
Sep 18, 2009 . 1 changed file with 2 additions and 33 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,38 +3,7 @@ require 'rubygems' require 'sinatra' require 'sinatra/mapping' require 'todoapp' run Sinatra::Application -
hallison created this gist
Aug 6, 2009 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ # In rackup file "config.ru" require 'rubygems' require 'sinatra' require 'sinatra/mapping' require 'sinatra/mapping_helpers' require 'yourapp' run Sinatra::Applicatoin # In Sinatra application "yourapp.rb" register Sinatra::Mapping helpers Sinatra::MappingHelpers mapping :users => "authors", :posts => "articles" get users_path do # URL usage: /authors erb :users end get users_path "/:user_id" do |user_id| # URL usage: /authors/7 erb :user end get users_path "/:user_id", :posts do |user_id| # URL usage: /authors/7/articles # In ERB template: link_to "Author Articles", :users, 7, :articles erb :posts end get users_path "/:user_id", :posts, "/:article_id" do |user_id, article_id| # URL usage: /authors/7/articles/8 # In ERB template: link_to "Article", :users, 7, :posts, 8 erb :post end