Skip to content

Commit

Permalink
add will_paginate recipe padrino#16
Browse files Browse the repository at this point in the history
  • Loading branch information
achiurizo committed Sep 2, 2011
1 parent 516864d commit 863a23b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -59,6 +59,7 @@ The plugin folders contains templates that can be ran to *plugin* certain librar
* resque - Add support for the resque redis based background worker
* barista - Add support for Coffeescript via Barista
* protection - Add support rack-protection to your app to protect against certain security exploitations
* will\_paginate - Add support for will\_paginate

### Templates

Expand Down
15 changes: 15 additions & 0 deletions plugins/will_paginate_plugin.rb
@@ -0,0 +1,15 @@
##
# Template to get will_paginate on Padrino
# prereqs:
#
# will_paginate provides orm integration with active_record, datamapper,
# and sequel out of the box.
#
# https://github.com/mislav/will_paginate/wiki/Installation
#

orm = (choice = fetch_component_choice(:orm)) =~ /sequel|activerecord|datamapper/ ? choice : ""
orm = '/data_mapper' if orm == "datamapper"
orm = '/active_record' if orm == "activerecord"
inject_into_file destination_root('app/app.rb'), " register WillPaginate::Sinatra\n", :after => "Padrino::Application\n"
inject_into_file destination_root('config/boot.rb')," require 'will_paginate#{orm}'\n", :after => "after_load do\n"

0 comments on commit 863a23b

Please sign in to comment.