Rajnish Singh
Joined
60 Experience
0 Lessons Completed
0 Questions Solved
Activity
Getting error
undefined method `map' for #Store:0x00007fd290f55ba8
Did you mean? tap
My Controller has following code
@select = Store.find(current_user.store_id)
My View has:
<%= form_with(model:@store, local: true) do |f| %>
<%= f.select :id, options_for_select(@select.name, :id), {:include_blank => '--Select Item--'}, { :class => 'form-control' } %>
<%= f.submit 'Submit', :class => 'btn btn-sm btn-primary m-t-n-xs' %>
<% end %>
<%= debug(@select.name) %>
This gives me the store name
Why am I not getting any data inside the Dropdown in browser?