alias url with sinatra / padrino

2019-04-02 03:56发布

I've this and it works

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

Is possible to do in some way "render" instead of "redirect"? or something like render 'posts/1'

1条回答
劫难
2楼-- · 2019-04-02 04:32
get :about, :map => '/about_us' do
  render :erb, "<%= 'foo' %>"
end

get '/:slug' do
  call env.merge('PATH_INFO' => '/about_us')
end
查看更多
登录 后发表回答