diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3eaefaf65..afd43d63d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,6 +2,11 @@ module ApplicationHelper FLASH_NOTICE_KEYS = [:error, :notice, :warning] + + def current_path(param_hash) + request.referer.include?('?') ? [request.referer,param_hash.to_param].join('&') : [request.referer,param_hash.to_param].join('?') + end + def delayed_impressionist(object) # Resque.enqueue_at(1.minute.from_now,DelayedImpressionist,object) end diff --git a/app/views/front/show_tag_cloud.html.erb b/app/views/front/show_tag_cloud.html.erb index d7e8308f4..5d3539282 100644 --- a/app/views/front/show_tag_cloud.html.erb +++ b/app/views/front/show_tag_cloud.html.erb @@ -3,7 +3,7 @@

<%= t(:tag_cloud) %>

<% @tags.each do |tag| %> - <%= link_to tag[0].name, '#?' + {:tag_id => tag[0].id, :category_id => params[:category_id]}.to_param, :class => "#{tag[1]} #{tag[0].id.to_s.eql?(params[:tag_id]) ? 'active' : nil} " %> + <%= link_to tag[0].name, current_path({:tag_id => tag[0].id, :category_id => params[:category_id]}), :class => "#{tag[1]} #{tag[0].id.to_s.eql?(params[:tag_id]) ? 'active' : nil} " %> <% end %>