Skip to content

Instantly share code, notes, and snippets.

@laurenproctor
Created April 8, 2013 15:54
Show Gist options
  • Save laurenproctor/5337903 to your computer and use it in GitHub Desktop.
Save laurenproctor/5337903 to your computer and use it in GitHub Desktop.
Person.rb in padrino
StudentDirectory::App.controllers :person do
# get :index, :map => '/foo/bar' do
# session[:foo] = 'bar'
# render 'index'
# end
# get :sample, :map => '/sample/url', :provides => [:any, :js] do
# case content_type
# when :js then ...
# else ...
# end
# get :foo, :with => :id do
# 'Maps to url '/foo/#{params[:id]}''
# end
# get '/example' do
# 'Hello world!'
# end
get :index do
"Hello #{params[:name]}"
end
post :create do
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment