2016-03-31 7 views
0

私はフリースタイル3.0.4を使用して、フローの回転式レールの宝石をインストールしました。 しかし、私のコードは、英雄ではなく、ローカルホストで動作しています。私はgemの代わりにjsファイルを使用しようとしましたが、それも同様に役立たなかった。ここ開発モードではなく、Herokuではないフクロウカルーセルレール

コードがそのテンプレート_artist_show.html.erb

<div class="carousel-container"> 
          <h2 class="carousel-title">Our Skilled Artists</h2> 
          <div class="row"> 
           <div id="artists-brief" class="owl-carousel from-theblog-carousel from-theblog-wide" style="display:inline;"> 

            <%ArtistProfile.take(6).each do |artist|%> 
             <article class="article"> 
              <div class="article-media-container"> 
               <a ><img src="<%=artist.a_img(:thumb)%>" class="img-responsive" alt="<%=artist.a_name%>"></a> 
              </div><!-- End .article-media-container --> 

              <div class="article-meta-box" style="padding-left:0;padding-right:0;"> 
               <span class="article-icon article-date-icon"></span> 
               <span class="meta-box-text"><%=artist.a_dob%></span> 
              </div><!-- End .article-meta-box --> 

              <h3><a ><%=artist.a_name%></a></h3> 
              <span class="meta-box-text"><%=truncate(artist.a_skills,length: 60)%></span> 
              <hr/> 
              <p><%=truncate(artist.a_brief,length: 100)%></p> 
              <a href="/artist_profiles/<%=artist.id%>" class="readmore" role="button">Read More</a> 
             </article><!-- End .article --> 
            <%end%>  

           </div><!-- End .container --> 
          </div><!-- End .container --> 
         </div><!-- End .carousel-container --> 

<%=javascript_tag do%> 
$(document).ready(function(){ 
$("#artists-brief").owlCarousel({ 

     autoPlay: 3000, 

     items : 2, 
     itemsDesktop : [1199,3], 
     itemsDesktopSmall : [979,3] 

    }); 
    $('.owl-pagination').css({"display":"none"}); 

    }); 
<%end%> 

である私は、メインのjsファイルにjsのコードを入れてみましたが、まだそれはHerokuの上DEVで働いたがいませんでした。

答えて

0

プロダクションでassestsのプリコンパイルが有効になっていることを確認してください。

/config/environments/production.rbこれらが存在することを確認してください。

config.assets.compile =真

config.assets.precompile = [」の.js'、 'の.css'、 '* .css.erb']

プリコンパイル

0123:あなたはHerokuのに自動化された資産のプリコンパイルをhaventは場合は、その後の資産

RAILS_ENV =生産バンドルのexecすくい資産をプリコンパイルするには、以下の実行

を押す前に

+0

ありがとうございましたが、私はすでにそれを行いました。しかし、私はそれが動作していない理由を得た、データベースから引っ張っていたデータは、コードを混乱させていた "(" ")" "のような文字を持っていました。理由はローカルホスト上で動作していた理由は、私はちょうど単純な文字列だったテストデータを持っていた –

関連する問題