0
레일의 form_for에 선택 옵션이 있습니다. 내가 설치하기 전에 작동하지만 설치 한 후에 더 이상 작동하지 않습니다. 아래에 내 코드를 참조하십시오 :MaterializeCSS를 사용하는 레일에서 선택 옵션이 작동하지 않습니다.
게임 모델
class Game < ActiveRecord::Base
GENRES = ['Action', 'Adventure', 'RPG', 'Simulation', 'Strategy', 'Sports', 'Others']
PLATFORMS = ['3DS', 'WII U', 'NX', 'PC', 'Playstation', 'XBOX', 'PS Vita', 'Mobile', 'Others']
end
new.html.erb
<h1> Add Game </h1>
<%= form_for :game, url: games_path do |f| %>
Title: <%= f.text_field :title %> <br />
Genre: <%= f.collection_select :genre, Game::GENRES, :to_s, :to_s, :include_blank => true %> <br />
Platform: <%= f.collection_select :platform, Game::PLATFORMS, :to_s, :to_s, :include_blank => true %> <br />
Release Date: <%= f.date_field :release_date %> <br />
Progress: <%= f.number_field :progress %> <br />
Rating: <%= f.number_field :rating %> <br />
<%= f.submit 'Add Game', class: 'add_game_button' %>
<%end%>