Rails开发过程中碰到过的问题

1.DEPRECATIONWARNING:config.action_view.debug_rjswillberemovedin3.1,from3.1onwardsyouwillneedtoinstallprototype-railstocontinuetouseRJStemplates.(calledfrom<top(required)>at/Users/me/projects/my_app/config/environment.rb:5)

解决方案:

Thewarningisbeingcausedbyyourconfigfile.Lookforalinelikeconfig.action_view.debug_rjs=truein{app_root}/config/environments/development.rborproduction.rbandcommentitout.Ifyou'renotusingrjsviewsanywaythenyouwon'tmissthedebuggingindevelopmentmodeanyway(andit'soffbydefaultinproduction)

2.DEPRECATIONWARNING:<%%>styleblockhelpersaredeprecated.Pleaseuse<%=%>.

解决:

Rails3.0.9printswarninginlogforspree_static_content/app/views/admin/pages/edit.html.erb.

Ithinkprobleminfollowingcode:

<% semantic_form_for([:admin, @page]) do |f| -%>
  <%= render :partial => "form", :locals => { :f => f } %>
  <p class="form-buttons">
    <%= button t("actions.update"), nil, 'submit' %>
    <%= t("or") %> <%= link_to t("actions.cancel"), admin_pages_path %>
  </p>
<% end %>

Itshouldchangetheline

<% semantic_form_for([:admin, @page]) do |f| -%>

to

<%= semantic_form_for([:admin, @page]) do |f| -%>

相关推荐