bastos (owner)

Fork Of

Revisions

gist: 35164 Download_button fork
public
Public Clone URL: git://gist.github.com/35164.git
Embed All Files: show embed
from.rb #
1
2
3
4
5
6
7
8
9
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
to.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
## Using ? will make the previous section optional
## NOTE the ? after the .
 
get '/:id.?:format?' do
  @vent = Vent.get(params[:id])
  case params[:format]
  when 'xml'
    builder :show
  else
    erb :show
  end
end