app/controllers/recommender/entries_controller.rb in muck-raker-0.1.4 vs app/controllers/recommender/entries_controller.rb in muck-raker-0.1.5
- old
+ new
@@ -3,20 +3,20 @@
def initialize
@no_index = true
end
def index
- @tags = CloudCache.language_tags('en') unless fragment_exist?({:controller => 'entries', :action => 'index'})
+ @tag_cloud = TagCloud.language_tags(Language.locale_id) unless fragment_exist?({:controller => 'entries', :action => 'index', :language => Language.locale_id})
respond_to do |format|
format.html { render :template => 'entries/index' }
end
end
def browse_by_tags
- @browse_tags = params[:tags]
- @top_tags = Entry.top_tags(@browse_tags)
- @search = @browse_tags.join(' ') if (!@browse_tags.nil? && !@browse_tags.empty?)
+ @tag_filter = params[:tags]
+ @search = @tag_filter.join(' ') if (!@tag_filter.nil? && !@tag_filter.empty?)
+ @tag_cloud = TagCloud.language_tags(Language.locale_id, @tag_filter) unless fragment_exist?({:controller => 'entries', :action => 'index', :language => Language.locale_id, :filter => @tag_filter})
_search
respond_to do |format|
format.html { render :template => 'entries/browse_by_tags' }
end
end
@@ -32,10 +32,10 @@
def _search
@offset = (params[:offset] || 0).to_i
@limit = (params[:limit] || 10).to_i
@term_list = URI.escape(@search) if !@search.nil?
if !@search.nil?
- results = Entry.search(@search, 'en', @limit, @offset)
+ results = Entry.search(@search, I18n.locale.to_s, @limit, @offset)
@results = results.results
@hit_count = results.total
end
end