Method: BaseHelper#search_user_posts_path

Defined in:
app/helpers/base_helper.rb

#search_user_posts_path(rss = false) ⇒ Object



294
295
296
297
298
299
300
301
# File 'app/helpers/base_helper.rb', line 294

def search_user_posts_path(rss = false)
  options = params[:q].blank? ? {} : {:q => params[:q]}
  options[:format] = :rss if rss
  [[:user, :user_id], [:forum, :forum_id]].each do |(route_key, param_key)|
    return send("#{route_key}_sb_posts_path", options.update(param_key => params[param_key])) if params[param_key]
  end
  options[:q] ? search_all_sb_posts_path(options) : send("all_#{prefix}sb_posts_path", options)
end