質問編集履歴
7
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -108,8 +108,8 @@
|
|
108
108
|
<body back-groundcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|
109
109
|
<img src="assets/map6.gif" width="1920" height="1080" alt="" usemap="#map6_Map">
|
110
110
|
<map name="map6_Map">
|
111
|
-
<area shape="poly" alt="" coords="419,860, 418,844, 418,822, 419,818, 423,817, 436,817, 449,818, 450,822, 450,859, 448,861, 423,861, 419,860" href="#shiga(現在ここは各都道府県の投稿検索後の
|
112
|
-
<area shape="poly" alt="" coords="257,853, 257,836, 258,833, 262,832, 284,832, 287,833, 288,836, 288,871, 287,874, 284,875, 261,875, 258,874, 257,871, 257,853" href="#hiroshima(現在ここは各都道府県の投稿検索後の
|
111
|
+
<area shape="poly" alt="" coords="419,860, 418,844, 418,822, 419,818, 423,817, 436,817, 449,818, 450,822, 450,859, 448,861, 423,861, 419,860" href="#shiga(現在ここは各都道府県の投稿検索後のherokuのURLを添付している)">
|
112
|
+
<area shape="poly" alt="" coords="257,853, 257,836, 258,833, 262,832, 284,832, 287,833, 288,836, 288,871, 287,874, 284,875, 261,875, 258,874, 257,871, 257,853" href="#hiroshima(現在ここは各都道府県の投稿検索後のherokuのURLを添付している)">
|
113
113
|
※以下残りの47都道府県分のコードが記載されている
|
114
114
|
|
115
115
|
</map>
|
6
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
検索欄の日本地図での投稿検索において、Illustratorで取得したコードの各都道府県のhrefには、メニューバー選択による都道府県ごとの投稿検索後のherokuのURLをコピペしている現状です。
|
8
8
|
|
9
9
|
### 解決したいこと
|
10
|
+
herokuのURLをコピペしていることが原因で、挙動が不便になってしまっている為、
|
10
11
|
検索欄の日本地図での投稿検索において、localhostではlocalhostの、herokuではherokuの投稿を検索できるようにするためにはhrefにどういったパスを置くべきか、また解決の為に他の方法があればアドバイスを頂きたいです。
|
11
12
|
検索欄の日本地図での投稿検索において、Illustratorで取得したコードの各都道府県のhrefには、メニューバー選択による都道府県ごとの投稿検索後のherokuのURLをコピペしている現状。これでは、localhostでの挙動確認の際に、herokuの検索結果に遷移してしまい不便である。また、hrefにlocalhostのURLを添付してもherokuでの挙動確認の際に、localhostの検索結果に遷移してしまい不便が生じる。
|
12
13
|
|
5
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -107,8 +107,8 @@
|
|
107
107
|
<body back-groundcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|
108
108
|
<img src="assets/map6.gif" width="1920" height="1080" alt="" usemap="#map6_Map">
|
109
109
|
<map name="map6_Map">
|
110
|
-
<area shape="poly" alt="" coords="419,860, 418,844, 418,822, 419,818, 423,817, 436,817, 449,818, 450,822, 450,859, 448,861, 423,861, 419,860" href="#shiga(現在ここは各都道府県の投稿検索後のlocalhostかherokuのURLを添付している
|
111
|
-
<area shape="poly" alt="" coords="257,853, 257,836, 258,833, 262,832, 284,832, 287,833, 288,836, 288,871, 287,874, 284,875, 261,875, 258,874, 257,871, 257,853" href="#hiroshima(ここは各都道府県の投稿検索後のlocalhostかherokuのURLを添付)">
|
110
|
+
<area shape="poly" alt="" coords="419,860, 418,844, 418,822, 419,818, 423,817, 436,817, 449,818, 450,822, 450,859, 448,861, 423,861, 419,860" href="#shiga(現在ここは各都道府県の投稿検索後のlocalhostかherokuのURLを添付している)">
|
111
|
+
<area shape="poly" alt="" coords="257,853, 257,836, 258,833, 262,832, 284,832, 287,833, 288,836, 288,871, 287,874, 284,875, 261,875, 258,874, 257,871, 257,853" href="#hiroshima(現在ここは各都道府県の投稿検索後のlocalhostかherokuのURLを添付している)">
|
112
112
|
※以下残りの47都道府県分のコードが記載されている
|
113
113
|
|
114
114
|
</map>
|
4
書式の修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
画像クリックにより
|
1
|
+
画像クリックにより同ブラウザ上の投稿検索をできるようにしたい
|
body
CHANGED
@@ -7,17 +7,11 @@
|
|
7
7
|
検索欄の日本地図での投稿検索において、Illustratorで取得したコードの各都道府県のhrefには、メニューバー選択による都道府県ごとの投稿検索後のherokuのURLをコピペしている現状です。
|
8
8
|
|
9
9
|
### 解決したいこと
|
10
|
-
検索欄の日本地図での投稿検索において、
|
10
|
+
検索欄の日本地図での投稿検索において、localhostではlocalhostの、herokuではherokuの投稿を検索できるようにするためにはhrefにどういったパスを置くべきか、また解決の為に他の方法があればアドバイスを頂きたいです。
|
11
|
+
検索欄の日本地図での投稿検索において、Illustratorで取得したコードの各都道府県のhrefには、メニューバー選択による都道府県ごとの投稿検索後のherokuのURLをコピペしている現状。これでは、localhostでの挙動確認の際に、herokuの検索結果に遷移してしまい不便である。また、hrefにlocalhostのURLを添付してもherokuでの挙動確認の際に、localhostの検索結果に遷移してしまい不便が生じる。
|
11
12
|
|
12
13
|
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
### 前提・実現したいこと
|
17
|
-
|
18
|
-
検索欄の日本地図での投稿検索において、Illustratorで取得したコードの各都道府県のhrefには、メニューバー選択による都道府県ごとの投稿検索後のherokuのURLをコピペしている現状。これでは、localhostでの挙動確認の際に不便である。hrefにlocalhostのURLを添付してもherokuでの挙動確認の際に不便が生じる。その為、hrefにどういったパスを置くべきかなど解決の為のアドバイスを頂きたいです。よろしくお願いします。
|
19
|
-
|
20
|
-
|
21
15
|
### 該当するソースコード
|
22
16
|
|
23
17
|
|
@@ -103,11 +97,26 @@
|
|
103
97
|
end
|
104
98
|
</code>
|
105
99
|
```
|
100
|
+
●_japanmap.html.erb 日本地図のソースコード
|
101
|
+
```
|
102
|
+
<html>
|
103
|
+
<head>
|
104
|
+
<title>map6</title>
|
105
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
106
|
+
</head>
|
107
|
+
<body back-groundcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|
108
|
+
<img src="assets/map6.gif" width="1920" height="1080" alt="" usemap="#map6_Map">
|
109
|
+
<map name="map6_Map">
|
110
|
+
<area shape="poly" alt="" coords="419,860, 418,844, 418,822, 419,818, 423,817, 436,817, 449,818, 450,822, 450,859, 448,861, 423,861, 419,860" href="#shiga(現在ここは各都道府県の投稿検索後のlocalhostかherokuのURLを添付しているが、)">
|
111
|
+
<area shape="poly" alt="" coords="257,853, 257,836, 258,833, 262,832, 284,832, 287,833, 288,836, 288,871, 287,874, 284,875, 261,875, 258,874, 257,871, 257,853" href="#hiroshima(ここは各都道府県の投稿検索後のlocalhostかherokuのURLを添付)">
|
112
|
+
※以下残りの47都道府県分のコードが記載されている
|
113
|
+
|
114
|
+
</map>
|
115
|
+
</body>
|
116
|
+
</html>
|
117
|
+
```
|
106
118
|
### 試したこと
|
107
119
|
|
108
|
-
日本地図ソースコードのhrefにトップページ(index.html.erb)のパスにArea.rbの都道府県指定して設置できたらと考えて置いてみたがわからなかった。
|
120
|
+
●日本地図ソースコードのhrefにトップページ(index.html.erb)のパスにArea.rbの都道府県指定して設置できたらと考えて置いてみたがわからなかった。
|
109
121
|
(例)href="/tweets/@tweet.Area_id[4]" ?
|
110
|
-
|
111
|
-
|
122
|
+
●日本地図ソースコードの_japanmap.html.erb をArea.rbのようにActiveHashで記述できたらransackで検索をかけられると考えるが、その記述の仕方も調べきれなかった。
|
112
|
-
|
113
|
-
ここにより詳細な情報を記載してください。
|
3
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,8 +11,18 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
|
14
|
+
|
15
|
+
|
16
|
+
### 前提・実現したいこと
|
17
|
+
|
18
|
+
検索欄の日本地図での投稿検索において、Illustratorで取得したコードの各都道府県のhrefには、メニューバー選択による都道府県ごとの投稿検索後のherokuのURLをコピペしている現状。これでは、localhostでの挙動確認の際に不便である。hrefにlocalhostのURLを添付してもherokuでの挙動確認の際に不便が生じる。その為、hrefにどういったパスを置くべきかなど解決の為のアドバイスを頂きたいです。よろしくお願いします。
|
19
|
+
|
20
|
+
|
14
21
|
### 該当するソースコード
|
22
|
+
|
23
|
+
|
15
24
|
●controller
|
25
|
+
```
|
16
26
|
|
17
27
|
<code>
|
18
28
|
def index
|
@@ -21,7 +31,11 @@
|
|
21
31
|
end
|
22
32
|
</code>
|
23
33
|
|
34
|
+
|
35
|
+
|
36
|
+
```
|
24
37
|
●index.html.erb メニューバー都道府県検索
|
38
|
+
```
|
25
39
|
<code>
|
26
40
|
<span class= 'search-btn'>検索</span>
|
27
41
|
<%= search_form_for @search do |f| %>
|
@@ -31,7 +45,9 @@
|
|
31
45
|
</div>
|
32
46
|
</code>
|
33
47
|
|
48
|
+
```
|
34
49
|
●Area.rb
|
50
|
+
```
|
35
51
|
<code>
|
36
52
|
class Area < ActiveHash::Base
|
37
53
|
self.data = [
|
@@ -86,14 +102,12 @@
|
|
86
102
|
]
|
87
103
|
end
|
88
104
|
</code>
|
105
|
+
```
|
106
|
+
### 試したこと
|
89
107
|
|
108
|
+
日本地図ソースコードのhrefにトップページ(index.html.erb)のパスにArea.rbの都道府県指定して設置できたらと考えて置いてみたがわからなかった。
|
109
|
+
(例)href="/tweets/@tweet.Area_id[4]" ?
|
90
110
|
|
111
|
+
### 補足情報(FW/ツールのバージョンなど)
|
91
112
|
|
92
|
-
|
93
|
-
|
94
|
-
●日本地図ソースコードのhrefにメニューバー都道府県検索後のURLをコピペして同じく検索できるようにしている。
|
95
|
-
|
96
|
-
|
97
|
-
|
113
|
+
ここにより詳細な情報を記載してください。
|
98
|
-
日本地図ソースコードのhrefにトップページ(index.html.erb)のパスにArea.rbの都道府県指定して設置できたらと考えて置いてみたがわからなかった。
|
99
|
-
(例)href="/tweets/@tweet.Area_id[4]" ?
|
2
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
### はじめに
|
2
|
-
最近プログラミングスクールを卒業したものです。初めて
|
2
|
+
最近プログラミングスクールを卒業したものです。初めてteratailにて質問させていただくので、至らないところがあると思いますが、アドバイスいただけると有り難いです。よろしくお願いします。
|
3
3
|
### アプリの概要
|
4
4
|
Ruby on Railsで旅行投稿アプリを作成しています。
|
5
5
|
新規投稿時にメニューバーから都道府県の選択を必須にしており、投稿一覧ページの検索欄からメニューバー選択により都道府県ごとの投稿を検索できるようにしました。
|
@@ -14,25 +14,25 @@
|
|
14
14
|
### 該当するソースコード
|
15
15
|
●controller
|
16
16
|
|
17
|
-
<
|
17
|
+
<code>
|
18
18
|
def index
|
19
19
|
@search = Tweet.ransack(params[:q])
|
20
20
|
@tweet = @search.result(distinct: true).order("created_at DESC")
|
21
21
|
end
|
22
|
-
</code>
|
22
|
+
</code>
|
23
23
|
|
24
24
|
●index.html.erb メニューバー都道府県検索
|
25
|
-
<
|
25
|
+
<code>
|
26
26
|
<span class= 'search-btn'>検索</span>
|
27
27
|
<%= search_form_for @search do |f| %>
|
28
28
|
<div class='search-btn'>
|
29
29
|
<%=f.label :area_id_eq,'都道府県'%>
|
30
30
|
<%= f.collection_select :area_id_eq, Area.all,:id,:name, include_blank: '指定なし' %>
|
31
31
|
</div>
|
32
|
-
</code>
|
32
|
+
</code>
|
33
33
|
|
34
34
|
●Area.rb
|
35
|
-
<
|
35
|
+
<code>
|
36
36
|
class Area < ActiveHash::Base
|
37
37
|
self.data = [
|
38
38
|
{ id: 1, name: '--' },
|
@@ -85,7 +85,7 @@
|
|
85
85
|
{ id: 48, name: '沖縄県' },
|
86
86
|
]
|
87
87
|
end
|
88
|
-
</code>
|
88
|
+
</code>
|
89
89
|
|
90
90
|
|
91
91
|
|
1
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,20 +14,25 @@
|
|
14
14
|
### 該当するソースコード
|
15
15
|
●controller
|
16
16
|
|
17
|
+
<pre><code>
|
17
18
|
def index
|
18
19
|
@search = Tweet.ransack(params[:q])
|
19
20
|
@tweet = @search.result(distinct: true).order("created_at DESC")
|
20
21
|
end
|
22
|
+
</code></pre>
|
21
23
|
|
22
24
|
●index.html.erb メニューバー都道府県検索
|
25
|
+
<pre><code>
|
23
26
|
<span class= 'search-btn'>検索</span>
|
24
27
|
<%= search_form_for @search do |f| %>
|
25
28
|
<div class='search-btn'>
|
26
29
|
<%=f.label :area_id_eq,'都道府県'%>
|
27
30
|
<%= f.collection_select :area_id_eq, Area.all,:id,:name, include_blank: '指定なし' %>
|
28
31
|
</div>
|
32
|
+
</code></pre>
|
29
33
|
|
30
34
|
●Area.rb
|
35
|
+
<pre><code>
|
31
36
|
class Area < ActiveHash::Base
|
32
37
|
self.data = [
|
33
38
|
{ id: 1, name: '--' },
|
@@ -80,6 +85,7 @@
|
|
80
85
|
{ id: 48, name: '沖縄県' },
|
81
86
|
]
|
82
87
|
end
|
88
|
+
</code></pre>
|
83
89
|
|
84
90
|
|
85
91
|
|