form helpers in v0.9.5 #8

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

When I updated from v0.9.1 to v0.9.5 I noticed some errors. In one of my views I have

<% for item in [:mon, :tue, :wed, :thu, :fri, :sat, :sun] %>
    <span>
        <%= f.check_box item %>
        <%= f.label item %>
    </span>
<% end %>

Before the update there were no problems but after the update the row <%= f.label item %> is giving me the following error

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]

The error only occurs I use the simple form helper. The trace gives me

active_enum (0.9.5) lib/active_enum/extensions.rb:54:in `active_enum_for'
active_enum (0.9.5) lib/active_enum/form_helpers/simple_form.rb:9:in `default_input_type_with_active_enum'
simple_form (1.4.2) lib/simple_form/form_builder.rb:272:in `label'

I had the same error when using Formtastic on Devise models with active_enum v.0.9.5 installed. The above commit solves the issue for me.

I confirm that the above commit solves the issue.

Owner

adzap commented Sep 12, 2011

I have fixed this in slightly different way in v0.9.6. Thanks for the pull request.

@adzap adzap closed this Sep 12, 2011

v0.9.6 confirmed to solve the issue here. Has this been pushed to GitHub?

Owner

adzap commented Sep 12, 2011

No, I forgot. Will do it later.

On 13/09/2011, at 8:44 AM, Jason Weatheredreply@reply.github.com wrote:

v0.9.6 confirmed to solve the issue here. Has this been pushed to GitHub?

Reply to this email directly or view it on GitHub:
#8 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment