我有以下形式的parsial,我正在使用activeadmin在軌道項目上運行heroku。本地我使用的是sqlite,表單效果很好。如何解決Heroku中Rails 3.4 activeadmin中的布爾錯誤?
<%= semantic_form_for [:admin, @instagram_tag_search] do |f| %>
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :active, :as => :boolean %>
<% end %>
<%= f.buttons %>
<% end %>
在Heroku我收到以下錯誤
2012-09-03T16:01:23+00:00 app[web.1]: ActionView::Template::Error (undefined method `active' for #<InstagramTagSearch:0x000000068893b0>):
2012-09-03T16:01:23+00:00 app[web.1]: 2:
2012-09-03T16:01:23+00:00 app[web.1]: 4: <%= f.input :name %>
2012-09-03T16:01:23+00:00 app[web.1]: 3: <%= f.inputs do %>
2012-09-03T16:01:23+00:00 app[web.1]: 6: <% end %>
2012-09-03T16:01:23+00:00 app[web.1]: 5: <%= f.input :active, :as => :boolean %>
2012-09-03T16:01:23+00:00 app[web.1]: 7:
2012-09-03T16:01:23+00:00 app[web.1]: 8: <%= f.buttons %>
2012-09-03T16:01:23+00:00 app[web.1]: app/views/admin/instagram_tag_searches/_form.html.erb:5:in `block (2 levels) in _app_views_admin_instagram_tag_searches__form_html_erb___2113834955800283278_53730580'
2012-09-03T16:01:23+00:00 app[web.1]: app/views/admin/instagram_tag_searches/_form.html.erb:3:in `block in _app_views_admin_instagram_tag_searches__form_html_erb___2113834955800283278_53730580'
2012-09-03T16:01:23+00:00 app[web.1]: app/views/admin/instagram_tag_searches/_form.html.erb:1:in `_app_views_admin_instagram_tag_searches__form_html_erb___2113834955800283278_53730580'
在我看來,有PostgreSQL的方式的差異和SQLite處理布爾/複選框。本地我存儲的值是1或0.我想知道這個簡單的修復是什麼。
你運行遷移? – sumskyi
我沒有運行的所有遷移 – mattwallace