mila002
mila002

Reputation: 385

Select form in Rails simple_form returns hexadecimal address of object

Im' testing very simple form in rails using simple_form gem. I have three models as below:

class Raport < ApplicationRecord
  belongs_to :systemname
  belongs_to :user
end

class Systemname < ApplicationRecord
  has_many :raports
end

class User < ApplicationRecord
  has_many :raports
end

My new.html.erb file

<%= simple_form_for @raport do |f| %>
  <%= f.association :systemname, prompt: "---choose one---" %>
  <%= f.input :rsi %>
  <%= f.input :crit %>

  <%= f.submit class: "btn btn-primary btn-sm" %>

<% end %>

My model's stucture

model user user:string email:string
model systemname sname:string
model raport sysname:string rsi:integer crit:string user_id:integer systemname_id:integer

I added to model systemname a few sname entires but my dropdown form presents them as hexadecimal entires like this:

hexadeciaml_form

What did I miss this time?

Upvotes: 0

Views: 29

Answers (0)

Related Questions