Skip to content

Bug: NoMethodError: undefined method 'guide_category_id' #61

Description

@andrewhavens

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions