teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

3

a

2017/03/31 05:33

投稿

moke
moke

スコア2241

answer CHANGED
@@ -1,5 +1,5 @@
1
1
  ```ruby
2
- <%= f.select :type_eq, options_for_select([['選択してください', ''], ['A','A'], ['B','B'],["C","C"]] %>
2
+ <%= f.select :type_eq, options_for_select([['選択してください', ''], ['A','A'], ['B','B'],["C","C"]]) %>
3
3
 
4
4
  ```
5
5
  で動くと思います。

2

2017/03/31 05:33

投稿

moke
moke

スコア2241

answer CHANGED
@@ -1,5 +1,5 @@
1
1
  ```ruby
2
- <%= f.select :type_eq, options_for_select([['選択してください', ''], ['A'], ['B'],["C"]], :selected => f.object.try(:type_eq)||'選択してください') %>
2
+ <%= f.select :type_eq, options_for_select([['選択してください', ''], ['A','A'], ['B','B'],["C","C"]] %>
3
3
 
4
4
  ```
5
5
  で動くと思います。

1

修正

2017/03/31 05:30

投稿

moke
moke

スコア2241

answer CHANGED
@@ -1,5 +1,5 @@
1
1
  ```ruby
2
- <%= f.select :type_eq, options_for_select([['選択してください', ''], ['A'], ['B'],["C"]], :selected => f.object.try(:type)||'選択してください') %>
2
+ <%= f.select :type_eq, options_for_select([['選択してください', ''], ['A'], ['B'],["C"]], :selected => f.object.try(:type_eq)||'選択してください') %>
3
3
 
4
4
  ```
5
5
  で動くと思います。