2

我有这个并且有效

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

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

4

1 回答 1

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

get '/:slug' do
  call env.merge('PATH_INFO' => '/about_us')
end
于 2010-09-05T13:29:41.753 回答