Bonanza

Bonanza provides some nice helpers and enhancements for nine.ch Rails apps.

For real cowboys only!

Bonanza

Installation

Add this line to your application's Gemfile:

gem 'bonanza'

And then execute:

$ bundle

There is a basic little helper to get an application's url. To use the urn specific link helpers, the infrastructure-client dependency is required.

nine_app_url(:redmine, :issue, '123')
=> "https://redmine.nine.ch/issues/123"

There are two link helpers for the nine ticket systems. One for customer profiles and one for tickets.

Link to a customer profile:

<%= link_to_otrs_customer 'OTRS Customer Profile', 5247, class: 'blue' %>

Link to an otrs ticket:

<%= link_to_otrs_ticket 'OTRS Ticket', '2014110610000325' %>

Link to customer data in Billing:

<%= link_to_billing 'Billing', 5247, class: 'blue' %>

Link to customer data in the Mighty Stats:

<%= link_to_stats 'Stats', 5247, class: 'black' %>

Link to a redmine issue:

<%= link_to_redmine 'Redmine', 123 %>

Link to a migration item:

<%= link_to_migration_item 'Migration', 123 %>

Link to a resource represented by a URN:

<%= link_to_urn 'VServer', 'urn:nine:vserver:1279' %>

Validators

Bonanza can validate OTRS Ticket numbers. But don't fear! It just checks for a 16-character number.

class Order < ActiveRecord::Base
  include Bonanza::Validators
  validates :otrs_ticket, otrs_number: true
end

Bonanza can validate nine urns, like 'urn:nine:vserver:1234'. To use this validator, the infrastructure-client dependency is required.

class Order < ActiveRecord::Base
  include Bonanza::Validators
  validates :urn, urn: true
end