Sha256: e665c01d3b22e8ea1551f4143b52760222f4b1280225ac21bcc47b4e0155f560

Contents?: true

Size: 419 Bytes

Versions: 1

Compression:

Stored size: 419 Bytes

Contents

class Interpret::SearchController < Interpret::BaseController

  def perform
    t = Interpret::Translation.arel_table
    search_key = params[:key].split(" ").map{|x| "%#{CGI.escape(x)}%"}
    search_value = params[:value].split(" ").map{|x| "%#{CGI.escape(x)}%"}
    @translations = Interpret::Translation.locale(I18n.locale).where(t[:key].matches_all(search_key).or(t[:value].matches_all(search_value))  )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
interpret-0.1.5 app/controllers/interpret/search_controller.rb