alias url with sinatra / padrino

时间:2010-08-01 23:20:22

标签: routing sinatra padrino

我有这个并且它有效

  get :about, :map => '/about_us' do
    render :erb, "<%= 'foo' %>"
  end
  get '/:slug' do
    redirect "/about_us" # <--
  end

可以用某种方式“渲染”而不是“重定向”吗? 或类似渲染'posts / 1'

1 个答案:

答案 0 :(得分:3)

get :about, :map => '/about_us' do
  render :erb, "<%= 'foo' %>"
end

get '/:slug' do
  call env.merge('PATH_INFO' => '/about_us')
end