How to update and edit One to Many relationship MVC in ruby on rails?
问题 I have a simple question, all I need is to edit and delete one to many relationship in rails in my case Status belongs to user and User has many statuses Here is what I have tried In status edit.html.erb <h1>Edit Status of doctor <%= @user.name %></h1> <%= form_for @status,:url => {:action => :update, :id => @user.id} do |f| %> status: (Received, Processed, Shipped) <%= f.text_field :name %><br> <%= f.submit %> <% end %> I have this error undefined method `name' for nil:NilClass status