Skip to content

The easy way to add Active Model Serializers to your Tire results.

License

Notifications You must be signed in to change notification settings

blakemcintyre/tire_am_serializers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Active Model Serializers + Tire (Beta)

The easy way to add Active Model Serializers to your Tire (client for the Elasticsearch search engine) results.

Installation

Drop this line to your application's Gemfile:

gem 'tire-am_serializers'

Usage

Same as Active Model Serializers:

render json: User.search(...)

There is only one thing, Rails will look for TireUserSeralizer by default. If class doesn't exist, it will try to find UserSerailizer. If no Serilaizers present for this model, it will use default behaviour of to_json.

If you want to get old behaviour from Tire:

render json: Vacancy.search("*").to_json

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

The easy way to add Active Model Serializers to your Tire results.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%