开发者

alias url with sinatra / padrino

开发者 https://www.devze.com 2023-01-10 06:32 出处:网络
I\'ve this and it works get :about, :map => \'/about_us\'开发者_开发知识库 do render :erb, \"<%= \'foo\' %>\"

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'


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

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

精彩评论

暂无评论...
验证码 换一张
取 消