mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.98k stars 1.19k forks source link

NoMethodError in QuestionsController#update, undefined method `new' for " ":String Did you mean? next #835

Open jerflan opened 7 years ago

jerflan commented 7 years ago

Getting this when I try to to add/edit tags in create/update.

based on this tutorial

I've tried both options in the form (. Create/update works just fine when I remove the tag div from the form. _form.html.erb

<%=  form_for(question) do |f| %>
  <div class="field">
    <%= f.label :user %>
    <%= f.collection_select :user_id, User.order(:first_name), :id, :full_name,  include_blank: true %>
  </div>
  <div class="field">
    <%= f.label :body %>
    <%= f.text_area :body %>
  </div>
  <div class="field">
    <%= f.label :active %>
    <%= f.check_box :active%>
  </div>
  <div class="field">
  <%= f.label :tags %>
  <%= f.text_field :tag_list %>
  </div>
  <div>
    <%= f.submit %>
  </div>
<% end %>

In the controller:

    def question_params
      params.require(:question).permit(:user_id, :body, :active, :tag_list)
    end

I'm a noob, so I'm hoping it's something stupid I did!