Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: NoMethodError: undefined method 'guide_category_id' #61

Open
andrewhavens opened this issue Sep 3, 2015 · 1 comment
Open

Bug: NoMethodError: undefined method 'guide_category_id' #61

andrewhavens opened this issue Sep 3, 2015 · 1 comment
Labels

Comments

@andrewhavens
Copy link
Contributor

There is an application error when you try to create a new guide:

NoMethodError: undefined method `guide_category_id' for #Guide:0x007f1f6f1cd140
app/views/guides/new.html.erb:18 · block in _app_views_guides_new_html_erb__618379928909969980_69886491947920

Looks like it's a problem with the form element:

<%= f.select :guide_category_id, @guide_categories.map { |gc| [gc.name, gc.id] }, {}, {class: 'form-control'} %>

I already ran the database migrations:

Migrating to AddGuideCategoryIdToPosts (20150901091113)
== 20150901091113 AddGuideCategoryIdToPosts: migrating ========================
-- add_column(:posts, :guide_category_id, :integer)
   -> 0.0136s
== 20150901091113 AddGuideCategoryIdToPosts: migrated (0.0139s) ===============

Migrating to CreateGuideCategories (20150901091523)
== 20150901091523 CreateGuideCategories: migrating ============================
-- create_table(:guide_categories)
   -> 0.1446s
== 20150901091523 CreateGuideCategories: migrated (0.1457s) ===================

/cc @AndrewRadev @soff22 @BubetoManolova

@AndrewRadev
Copy link

We can't seem to be able to reproduce the issue :/. I even checked out your master on my machine, ran migrations and all, and it seems to be working just fine. And, the build is working, and I think there was a test for exercising this functionality.

The guide_category_id field is a db field, so the only explanation I can think of is that somehow the migration didn't run. Or it ran in a different environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants