Easily add support for the server protocol expected by Unpoly.
Add this line to your application's Gemfile:
gem "roda-unpoly"
And then execute:
$ bundle
Or install it yourself as:
$ gem install roda-unpoly
Simply enable the plugin through the plugin
mechanism.
class App < Roda
plugin :unpoly
route do |r|
# Routing tree
end
end
Inside the routing tree, some convenience methods are made available to work with the Unpoly request.
Use the methods r.up?
, r.unpoly?
, r.up.up?
, or r.up.unpoly?
(they are
all aliases of the same method).
Use the method r.up.target?(your_target)
.
Use the method r.up.validate?
.
Use the method r.up.title=
.
I've chosen not to bundle those assets with the gem as they might be updated more frequently then this library. Roda is also asset-agnostic (for the most part), so it's easier if you bring in your assets as you see fit for your specific needs.
Bug reports and pull requests are welcome on GitHub at https://github.com/adam12/roda-unpoly.
I love pull requests! If you fork this project and modify it, please ping me to see if your changes can be incorporated back into this project.
That said, if your feature idea is nontrivial, you should probably open an issue to discuss it before attempting a pull request.
The gem is available as open source under the terms of the MIT License.