今現在、whereを使い、特定のカラムだけを抽出して表示しようとしていたのですが、画像の1段目だけ違う大きさになってしまって変えることができない状態になっています。他のページでは通常に表示されているのに、このページだけ違う位置になっています。もしわかる方がいらしたら、教えていただきたいです。
controller
1def category 2 @kobe = Plan.where(title: 'kobe') 3end
view1
1 <div class="story"> 2 3 <a href ="plans/:id/category" class="story-1">KOBE</a> 4 <a href ="plans/:id/next" class="story-1">OSAKA</a> 5 <a href ="plans/:id/tokyo" class="story-1">TOKYO</a> 6 <a href ="plans/:id/kyoto" class="story-1">KYOTO</a> 7 8 </div>
view2
1<div class="mainpage"> 2 3 <div class="contents center"> 4 5 <% @kobe.each do |plan| %> 6 <div class="posts"> 7 <div class="content_post" style="background-image: url(<%= plan.image.url %>);" > 8 <div class="more"> 9 10 <ul class="more_list"> 11 <li> 12 <%= link_to '', "/plans/#{plan.id}", method: :get %> 13 </li> 14 15 </ul> 16 </div> 17 <%= simple_format(plan.title) %> 18 <span class="name"> 19 <a href="/guiders/<%= plan.guider_id %>"> 20 <span>guider</span><%= plan.guider.nickname %> 21 </a> 22 </span> 23 24 </div> 25 </div> 26 27 <% end %> 28 29 </div> 30</div>
CSS
1.mainpage { 2 background-color: #fff; 3 height: 2000px; 4} 5 6.center { 7 width: 100%; 8 margin-left: 90px; 9 margin-right: 80px; 10 margin-top: 0; 11 margin-bottom: 0; 12 max-width: 1230px; 13 *zoom: 1; 14 15} 16 17div.contents.center, .sign_up, .life, .free, .info, .own, .avicii { 18 h2 { 19 @include boxBase(20px 0, 0); 20 font-weight: normal; 21 strong { 22 font-weight: bold; 23 padding-right: 5px; 24 font-size: 1.2em; 25 } 26 } 27} 28 29.posts { 30 width: 300px; 31 height: 300px; 32 display: inline-block; 33} 34 35div.content_post, .edm_post, .ichiran{ 36 @include boxBase(30px 0px, 15px); 37 position: relative; 38 height: 100%; 39 color: #fff; 40 border-radius: 3px; 41 box-shadow: 0 0 1px rgba($black,0.2); 42 display: inline-block; 43 width: 100%; 44 &:after { 45 content: ''; 46 position: absolute; 47 top: 0; 48 bottom: 0; 49 left: 0; 50 right: 0; 51 @include filter-gradient(#000000, #a60000, vertical); 52 @include background-image(linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 62%,rgba(0,0,0,0.85) 100%)); 53 z-index: 1; 54 border-radius: 3px; 55 } 56 .more { 57 position: absolute; 58 z-index: 2; 59 height: 300px; 60 width: 300px; 61 top: 2px; 62 right: 2px; 63 &:hover ul.more_list { 64 display: block; 65 } 66 ul.more_list { 67 position: absolute; 68 text-align: left; 69 width: 300px; 70 height: 300px; 71 right: 0; 72 display: none; 73 border-radius: 3px; 74 li { 75 border-bottom: 1px solid #ddd; 76 &:last-child { 77 border-bottom: 0; 78 } 79 a { 80 display: block; 81 width: 150px; 82 height: 150px; 83 } 84 } 85 } 86 }