您好我的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="✓" /><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 & 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
Theese是应用程序中使用的宝石
gem 'mongrel'
gem 'rails', '3.0.1'
gem 'haml'
gem "will_paginate", "3.0.pre2"
gem 'mysql',"2.8.1"
答案 0 :(得分:0)
看起来路线错误定义或未定义