diff options
-rw-r--r-- | app/controllers/public_body_controller.rb | 2 | ||||
-rw-r--r-- | app/views/public_body/show.html.erb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 4a0e3efcd..2b90fee42 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -82,6 +82,8 @@ class PublicBodyController < ApplicationController @existing_track = TrackThing.find_existing(@user, @track_thing) end + @follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) + @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ] diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb index ed4823dd9..931c85f64 100644 --- a/app/views/public_body/show.html.erb +++ b/app/views/public_body/show.html.erb @@ -60,7 +60,6 @@ <% end %> </div> <div class="action-bar__follow"> - <% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %> <div class="action-bar__follow-button"> <% if @existing_track %> <%= (link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => @existing_track.id, :track_medium => "delete", :r => request.fullpath}, :class => "link_button_green") %> @@ -74,8 +73,8 @@ <div class="action-bar__follower-count"> <%= n_("{{count}} follower", "{{count}} followers", - follower_count, - :count => content_tag(:span, follower_count, :id => "follow_count")) %> + @follower_count, + :count => content_tag(:span, @follower_count, :id => "follow_count")) %> </div> </div> </div> |