开发者

Routing issue while using high_voltage for static pages

I am trying to use high_voltage to serve up static pages. It seems to be working in that if I put .../pages/PAGE_NAME in the browser window it will bring up the correct page. The problem that I am having is that the default root doesn't appear to be working properly. When I go to http://localhost:3000 I get the home.html.erb page that I put in the view/pages directory inside of my application.html.haml layout. Basically, a page inside of a layout which is not what I expected.

I am following the instructions in that I have the following entries in my routes.rb file:

resources :pages
root :to => 'high_voltage/pages#show', :id => 'home'

I also have a PagesController with the following code:

class PagesController < HighVoltage::PagesController
  layout nil
end

It appears that my root route does not actually hit the PagesController (with layout nil) that I have in my code. How can I resolve thi开发者_高级运维s issue?


have you tried this ?

root :module=> :high_voltage, :controller => :pages, :action => :show, :id => 'home'

see root and match (used internally by root) for more info.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜