fesplugas/typus — Issue #339: undefined method `each_pair' for nil:NilClass
Author: bmidgley
Created: 2012-01-26 20:45:24+00:00
State: open

using typus 3.1.7 and a custom app/views/admin/users/_form.html.erb used under typus 3.0.x, I get this exception when I save a record. I traced it in and it looks like params[:_save] should be set in order for this to work. Who is responsible for setting this? Should I be rendering the form differently?

_form.html.erb:

<%= form_for @item, :url => admin_user_path(@item), :html => { :multipart => true } do |form| %>

<% if @item.errors.any? %>

<%= pluralize(@item.errors.count, "error") %> prohibited this page from being saved:

<% @item.errors.full_messages.each do |full_message| %>

<%= full_message %>

<% end %>

<% end %>

<%= raw build_form(fields, form) %>

<%= form.label :company_ids, "Company Access (Used in Reporting)" %>

<% Company.all(:order => :name).each do |company| %>

<%= check_box_tag "user[company_ids][]", company.id, @item.company_ids.include?(company.id) %>
<%= company.name %>

<% end %>

<%= submit_tag options[:button] , :class => "commit" %> or <%= link_to _t("Cancel and go back").downcase, :action => "index" %>

<% end %>