Skip to content

Usable with form_with? #55

Description

@trevordixon

I'm following http://guides.rubyonrails.org/getting_started.html. This simple form doesn't work with trix_editor, though it does with text_area. Error: "undefined method `to_key' for nil:NilClass. Did you mean? to_query"

<%= form_with scope: :job, url: jobs_path, local: true do |form| %>
  <p>
    <%= form.label :description %><br>
    <%= form.trix_editor :description %>
  </p>
<% end %>

The stack trace points to https://github.com/rails/rails/blob/master/actionview/lib/action_view/record_identifier.rb#L108.

I think it's trying to generate an id and class from an ActiveRecord, but the record is nil. Maybe because form_with is new, and trix_editor doesn't work with it yet?

(I beg your forgiveness in advance if this is a stupid question. I'm only about a day into learning Ruby and Rails.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions