Rajnish Singh


60 Experience
0 Lessons Completed
0 Questions Solved


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?

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.