私は自分のアプリケーションでLightbox2を使用しようとしています。私は宝石をインストールし、すべての手順に従いましたが、アプリケーションでそれをどこで呼び出すかを理解するのに問題がありました。Lightbox with Rails
これは私のポスト指標である
<div class="container">
<div id="profuploads">
<div id="posts" class="transitions-enabled">
<% @posts.each do |post| %>
<div class="box panel panel-default">
<%= link_to image_tag(post.image.url(:medium)), post %>
<div class="panel-body">
<strong><%= post.user.username if post.user %></strong><br/>
<%= post.description %>
<% if post.user == current_user %>
<div class="actions">
<%= link_to 'Edit', edit_post_path(post) %>
<%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
</div>
</div>
これが私のポストショーライトボックス付き
<div class="row">
<div class="col-md-offset-1 col-md-10">
<div class="panel panel-default">
<div class="panel-heading center">
<%= image_tag @post.image.url, height: '300' %>
</div>
<div class="panel-body">
<p><strong><%= link_to(@post.user.username.capitalize, user_path(@post.user.id)) if @post.user %></strong></p>
<p><%= @post.description %></p>
<div class="votes">
<strong>VIEWS</strong>
<%= @post.hits %>
<div class="votes">
<%= link_to like_post_path(@post), method: :put do%>
<button type="button" class="btn btn-info" aria-label="Left Align">
<span class="glyphicon glyphicon-thumbs-up glyphicon-align-center" aria-hidden="true"></span>
<span class="badge"><%= @post.get_upvotes.size %></span>
</button>
<%end%>
</div>
<% if @post.user == current_user %>
<%= link_to 'Edit', edit_post_path(@post) %>
<% end %>
</div>
</div>
</div>
</div>
である私はちょうど完全に私のポストショーのページのRIDはgitする必要がありますか?
ありがとうございます。私はそのデータライトの呼び出しが不足していることを知っていました。私はちょうどそれを置くべきか分からなかった。私はこれを試みたが、まだ何もしなかった。私の通常のショーページには –
と表示されています。私の質問はLightbox2ちょっと写真を拡大して実際に写真のURLに移動しないのですか? –
このフラグメントがレンダリングされた後の結果のHTMLを表示してください。 –