Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# sudo gem install stringex
# "Щукинская".to_ascii => Shchukinskaia
# "щукинская".to_ascii => shchukinskaia
require 'stringex'
class Post < ActiveRecord::Base
acts_as_indexed :fields => [:ascii_title, :ascii_body]
private
def ascii_title
self.title.to_ascii
end
def ascii_body
self.body.to_ascii
end
end
class PostsController < ApplicationController
def search
@posts = Post.find_with_index(params[:query].to_ascii)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.