移除静态页面导轨的高压页面 [英] Remove page/ of High Voltage for statics page rails

查看:22
本文介绍了移除静态页面导轨的高压页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在为 rails 中的静态页面使用 High Voltage,但是当我看到下一个结构时制作我的静态页面:

Hello I am using High Voltage for my statics pages in rails but I see the next structure when I make my statics pages:

myserver.com/pages/about

myserver.com/pages/about

myserver.com/pages/privacy

myserver.com/pages/privacy

myserver.com/pages/terms.

myserver.com/pages/terms .

.

.

.

我不希望出现 页面" 字样.我希望出现这种结构

I don't want that "page" word appear. I want that appear this structure

myserver.com/about

myserver.com/about

myserver.com/privacy

myserver.com/privacy

myserver.com/terms

myserver.com/terms

非常感谢.问候!

推荐答案

参见 这个错误

这可能有效:

match '/:id' => 'high_voltage/pages#show', :as => :static, :via => :get

当您使用上述说明时,您还需要浏览您的视图并更改以下所有实例:

When you use the above instructions, you also need to go through your views and change all instances of:

page_path(:id=>:about)

到:

static_path(:id=>:about)`

或者更好的是:

static_path(:about)

因此,在您的视图中找到所有 link_to 并进行上述更改...您的网址中将不再包含 页面 一词

So find all the link_to's in your views and make the changes above... Your urls will no longer have the word pages in them

希望能帮到你

这篇关于移除静态页面导轨的高压页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆