Home>
I want to solve

I want to resolve the error statement
https://gyazo.com/0be8fdc11813c25ea72bc2181155d89d
Error message "NoMethodError in Category # new"

code

category_controller.rb

class CategoryController</pre>
<p><strong>category/new.html.haml</strong></p>
<pre><code data-language = "Ruby">= form_with model: @category, local: true do | f |
  = f.text_field: name, class: "SettingGroupForm__input", placeholder: "Please enter the category name"
  = f.submit "Save", class: "SettingGroupForm__button"


views/messages/_side.html.haml

.side-bar
  .side-bar__main
    .first-list
      Thing I want to do
      = link_to new_category_path (current_user) do
        = icon ('fas','plus')
    .first-name__list-name
      By the time you die
    .second-list
      what to do
      = link_to new_deadline_path (current_user) do
        = icon ('fas','plus')
    .second-list__list-name
      Within 1 month
  • Answer # 1

    As far as the situation is seen from the code and error fragmentsNot on the railsIt's in a state (out of the standard Rails way).

    If you want to get on the railsCategoryControllerToCategoriesControllerAnd routingresources: categoriesPlease pull with.

    If you want to proceed as it is, sendurlToform_withPlease specify manually.