I think that it will be created, but I get an error statement saying Did you mean? Baggage_path, but I feel that this is a problem because I want to save it in the database in the first place.


    = form_for @baggage do | f |
          % span
            Luggage type
            = f.select: kind, [["Namamono", "Namamono"], ["Chilled", "Chilled"], ["Frozen", "Frozen"], ["Other", "Other" ]], include_blank: "Please select"
          % span
            Storage period
            = f.text_field: storage_period, class: "baggage_text", placeholder:'Example) 7'
            % span days
          % span
            Tracking number
            = f.text_field: code, class: "baggage_text", placeholder: '123456789012'
      -# = f.hidden_field: user_id,: value =>"# {user_session}"
      = f.hidden_field: user_id
      = f.submit'SEND', class: "baggage__send"


class Admin :: BaggagesController
  • Answer # 1

    In conclusion, it was because there was no create in the routing references: baggages part.

    I made two, one for the administrator and one for the general, but the administrator did not specify it, but the general one specified only new and show.
    The description is specified to save in the database with form_for.
    In other words, "I'm writing to process the create action, but I haven't set the routing in the first place."
    After that, if the controller file is the same as the administrator and general, the administrator can register the one associated with the general user (for some reason, there was no error in the browser, only the terminal got an error).

  • Answer # 2

    pages_show_path (@baggage)

    Isn't the part marked with the following?

    baggage_path (@baggage)