-
-
Save bastos/35164 to your computer and use it in GitHub Desktop.
Revisions
-
bmizerany revised this gist
Dec 10, 2008 . 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 @@ -3,7 +3,7 @@ get '/:id.?:format?' do @vent = Vent.get(params[:id]) case params[:format] when 'xml' builder :show else -
bmizerany created this gist
Dec 10, 2008 .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,10 @@ get '/:id' do @vent = Vent.get(params[:id]) erb :show end # show post get '/:id.xml' do @vent = Vent.get(params[:id]) builder :show end 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,13 @@ ## Using ? will make the previous section optional ## NOTE the ? after the . get '/:id.?:format?' do @vent = Vent.get(params[:id]) case :format when 'xml' builder :show else erb :show end end