app/views/users/doc_request.html.erb :
<% @docs.each do |doc| %>
<%= link_to 'Approve', User.activate_doctor(doc) %>
<% end %>
应用程序/模型/user.rb :
def self.activate_doctor(doc)
doc.active = 1 #simply setting the value of one column to 1.
end
它抛出错误
NoMethodError in Users#doc_request
Showing /home/ajay/Desktop/10th Spet/app/views/users/doc_request.html.erb where line #16 raised:
undefined method `model_name' for Fixnum:Class