I added ajax_pagination using this wiki https://github.com/ronalchn/ajax_pagination/wiki/Installing
it works but when i click on a link in the news section the slider on top shows up on the show page when its not suppose to be there but when you refresh the page it goes away and is back to normal
does anyone know how to fix this?
heres my view
batnews.html.erb
<div class="container">
<br /><br />
<h2 class="black">
Featured Articles
<div class="line_section"><div>
</h2>
<ul class="example2">
<% @articles.each do |article| %>
<li>
<h2><%= link_to(article.title, article, style: 'color: #4C4C4C;') %></h2>
<%= link_to image_tag(article.photo, style: 'width: 400px; float: left; margin-right: 20px; margin-top: -10px; height: 260px;'), article %>
<div class="info" style="position: relative; right: -20px; top: -3px;">
<img style="position: relative; top: -2px;" src="/assets/icon_calendar.png">
<%= article.date %>
<img style="position: relative; top: -2px;" src="/assets/icon_author.png">
<%= article.author %>
<img style="position: relative; top: -2px;" src="/assets/icon_talk.png">
<!-- TODO make this link scroll down to comments section smoothly -->
<%= link_to article.comments.count, article %> <%= link_to 'comments', article %></a>
</div>
<p style="width: 460px; float: right;"><%= truncate article.content, length: 400 %>
<br />
<%= link_to('Read More', article, style: 'font-size: 12px;') %></p>
</li>
<% end %>
</ul>
</div>
<%= ajax_section :id => "recent_news", :render => "recent_news" %>
heres my paritial that im rendering _recent_news.html.erb
<div class="container">
<br />
<br />
<h2 class="black">
Recent News
<div class="line_section"><div>
</h2>
<%= ajax_links :section_id => "recent_news" do %>
<%= will_paginate @news_all %>
<div class="row">
<div class="span12">
<ul class="recent-news">
<% @news_all.each do |news| %>
<li style="font-size: 16px; line-height: 19px; letter-spacing: 1px; font-size: 14px; color: #555; text-align: left;">
<%= link_to image_tag(news.photo.url), news, class: 'pull-left', style: 'margin-right:40px; margin-top: 2px; width: 300px;' %>
<div style=" width: 600px; float: right;">
<%= link_to news.title, news %>
<br />
<%= link_to news.date, news, style: 'font-size: 10px; color: black; position: relative; top: 15px;' %>
<i style="position: relative; top: 18px;" class="icon-comment"><%= link_to (news.comments.count), news, :style => 'font-size: 8px; color: white; font-weight: bold; position: absolute; top: 0px; right: 5px;' %></i>
<br /><br />
<%= truncate news.content, length: 500 %>
<br />
<%= link_to 'Read More...', news, style: 'font-size: 12px !important;' %>
</div>
</li>
<% end %>
<%= will_paginate @news_all %>
<% end %>
</div><!-- end span12 -->
</div><!-- end row -->
</div><!-- end container -->
heres my controller
static_pages_controller.rb
def batnews
@articles = Article.all
@news_all = News.all
@news_all = News.paginate(page: params[:page], per_page: 4, :order => 'created_at DESC')
@comment_count = Comment.count(:id)
respond_to do |format|
format.html # index.html.erb
ajax_respond format, :section_id => "recent_news"
end
end
here my gems
gem 'rails', '3.2.8'
gem 'bootstrap-sass', '2.0.4'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
gem 'jquery-ui-rails'
gem "haml", "~> 3.1.7"
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem 'activerecord-reputation-system', require: 'reputation_system'
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"
gem 'aws-sdk'
gem 'friendly_id'
gem 'ajax_pagination'
gem "jquery-historyjs"
heres the link to the site where you can see the behavior im talking about http://www.batman-fansite.com/batnews
so if you click on the one of the news in recent_news you will be taken to the show page scroll up and you will notice the slider still being there....hit refresh and the slider will be gone...
How can i fix this problem?