将路径更改为路径中的参数

时间:2012-09-05 17:37:50

标签: ruby-on-rails parameters routes

谷歌机器人想要打开我的Ajax地址,如: http://ots.wlasowy.ru/ru?_escaped_fragment_=/ru/pages/service 我在match 'pages/service', :to => 'pages#service'中有routes.rb的记录。

我需要向routes.rb添加什么?

我的routes.rb:

scope "(:locale)", :locale => /en|ru/ do

match '/pages/news' => 'pages#news'
match '/articles/page/:page',  :to => 'pages#news'
match '/pages/home' => 'pages#home'

resources :pages
resources :articles
resources :vacancies

mount Ckeditor::Engine => '/ckeditor'

mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'

devise_for :users

devise_scope :user do
  get "sign_in", :to => "devise/sessions#new"
end

end

1 个答案:

答案 0 :(得分:0)

添加您的route.rb,查看文件。你的代码中有一些错误。