There was an error while loading. Please reload this page.
You can configure Boxer to include a list of Ruby modules in every box.
include
Boxer.configure do |config| config.box_includes = [MyMethods, SomeOtherMethods] end
This is especially useful in Rails for URL generation methods:
Boxer.configure do |config| config.box_includes = [Rails.application.routes.url_helpers] end
Now you can use those URL generation methods inside of all your boxes without thinking twice:
Boxer.box(:user) do |box, user| { :name => user.name, :url => user_path(user), } end
For more, see Using Boxer with Rails.