I have the following form parsial that I’m using in activeadmin on in a rails project running on heroku. Locally I’m using sqlite and the form works great.
<%= semantic_form_for [:admin, @instagram_tag_search] do |f| %>
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :active, :as => :boolean %>
<% end %>
<%= f.buttons %>
<% end %>
On heroku I get the following error
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'
It seems to me there is a difference in the way postgreSQL and sqlite handle the boolean / checkbox. Locally the value I am storing is a 1 or 0. I’m wondering what the simple fix is for this.
You should make sure you have run all the migrations on heroku. They normally aren’t run as part of a deploy/push.