ruby - Creating folder structure using high_voltage gem in Rails -
i'm trying use high_voltage gem serve static pages in rails app. want individual sections own folder, can't quite work & can't find solution around web.
what want:
rails_root/app/views/pages/(page) routed '/(page)'
while rails_root/app/views/pages/(directory)/(page) => '/(directory)/(page)'
here's attempt:
routes.rb:
cam4::application.routes.draw root :to => 'high_voltage/pages#show', :id => 'index' match '/:id' => 'high_voltage/pages#show', :as => :static, :via => :get scope "ruby" match '/ruby/:id' => 'high_voltage/pages/ruby#show', :as => :static, :via => :get end end thanks lot,
cameron
actually ended solving problem on own using route globbing. given rails 3.2.5 app running high_voltage, view paths:
rails_root/app/views/pages/id [=> '/pages/id' or '/id']
rails_root/app/views/pages/ruby/id [=> 'pages/ruby/id' or 'ruby/id']
routes.rb:
cam4::application.routes.draw root :to => 'high_voltage/pages#show', :id => 'index' match '/*id' => 'high_voltage/pages#show', :as => :static, :via => :get end
Comments
Post a Comment