0

您好,我的 rails 3.0 表单有一个非常烦人的问题。我正在使用 CKEditor 让用户编辑其页面的 html 内容。在 rails 2 中一切正常,他制作了很多带有 html 内容的页面。但是后来我需要将 rails gem 更新到 3.0.1,因为这是需要的(服务器管理员更新到 rails 3 并删除了 2)。

在此更改之后,他想为新的季节(以旅游为导向的业务)编辑页面。某些页面无法更新我得到一个

403 Forbidden

Access to this resource on the server is denied!`

它让我发疯,我尝试了所有可能相关的解决方案,但仍然没有运气。

我认为这可能与随表单提交的 html 内容有关,因为当我删除内容并放置一些简单的段落文本时,它可以正常工作。但我不知道会是什么。

这是一个示例表格

<form accept-charset="UTF-8" action="/pages/113" class="jNice" id="edit_page_113" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /><input name="authenticity_token" type="hidden" value="w5ZUDHYHnFKHhLQc6UO/a3zwbN5p6JMgKYUWlVhbMiU=" /></div>
<fieldset>
<p>
<label for="page_category_id">Kategoria:</label>
<select id="page_category_id" name="page[category_id]"><option value=""></option>
<option value="13">School And Study Tours Groups</option>
<option value="23" selected="selected">Regular &amp; Group Tours To Poland </option>
<option value="14">Jewish History And Heritage Tours</option>
</select>
</p>
<p>
<label for="page_name">Nazwa podstrony:</label>
<input id="page_name" name="page[name]" size="30" type="text" value="Poland in a week - the Southern face" />
</p>
<p>
<label for="page_cities">Miasta imprezy:</label>
<input id="page_cities" name="page[cities]" size="30" type="text" value="Warsaw - Krakow - Wieliczka - Auschwitz - Czestochowa" />
</p>
<p>
<label for="page_keywords">Słowa kluczowe:</label>
<input id="page_keywords" name="page[keywords]" size="30" type="text" value="Poland tour,  tour of Warsaw, tours of Cracow, czestochowa Jasna gora tour" />
</p>
<p>
<label for="page_description">Skrócony opis:</label>
<input id="page_description" name="page[description]" size="30" type="text" value="2012 tour to Poland with visit to Wieliczka Salt Mine and Czestochowa " />
</p>
<p>
<label for="page_tour_of_the_month">Tour of the month na stronie głównej?:</label>
<input name="page[tour_of_the_month]" type="hidden" value="0" /><input id="page_tour_of_the_month" name="page[tour_of_the_month]" type="checkbox" value="1" />
</p>
<p>
<label for="page_html_body">Zawartość:</label>
<textarea class="ckeditor" cols="40" id="page_html_body" name="page[html_body]" rows="20">test</textarea>
</p>
<p>
<label for="page_published">Opublikowana?:</label>
<input name="page[published]" type="hidden" value="0" /><input checked="checked" id="page_published" name="page[published]" type="checkbox" value="1" />
</p>
<p>
<label for="page_show_request_link">Pokaż link rezerwacyjny?:</label>
<input name="page[show_request_link]" type="hidden" value="0" /><input checked="checked" id="page_show_request_link" name="page[show_request_link]" type="checkbox" value="1" />
</p>
</fieldset>

<p><input id="page_submit" name="commit" type="submit" value="edytuj" /></p>
</form>

这是 routes.rb 文件的内容

Gfp3::Application.routes.draw do
  resources :newscasts do
    get :publish, :on => :member
  end

  resources :links
  resources :payments
  resources :fronts
  resources :categories do
    collection do
       :sort
    end
  end

  resources :pages do
    get :publish, :on => :member
  end
  resources :menus

  match 'login',:to=>'index#login'
  match 'logout', :to=>'index#logout'
  match 'images', :to=>'images#index'
  match 'images/upload', :to=>'images#upload'
  match 'front_page',:to=>'front_page#index'
  match 'search',:to=>'index#search'

  match ':controller(/:action(/:id(.:format)))'
  root :to => 'index#index'
    match ':id',:to=>"pages#show"
end

这些是应用程序中使用的宝石

gem 'mongrel'
gem 'rails', '3.0.1'
gem 'haml'

gem "will_paginate", "3.0.pre2"
gem 'mysql',"2.8.1"
4

1 回答 1

0

看起来路由错误定义或未定义

于 2012-04-30T11:05:28.303 回答