Sha256: 04a3263f0e59da6c19b1bac0a0c9340fa7af9de912af3e9cfd497b31591c0618

Contents?: true

Size: 458 Bytes

Versions: 3

Compression:

Stored size: 458 Bytes

Contents

# ViewHelpers methods are made available in all controllers by the code in engine.rb.
module Balrog::ViewHelpers
  def balrog_logout_button(options = nil, html_options = nil)
    name = 'Logout'
    html_options ||= {}
    html_options[:method] = 'delete'

    if options.is_a?(String)
      name = options
    elsif options.is_a?(Hash)
      html_options = html_options.merge(options)
    end 

    button_to(name, '/balrog/logout', html_options)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
balrog-1.1.0 lib/balrog/view_helpers.rb
balrog-1.0.0 lib/balrog/view_helpers.rb
balrog-0.2.0 lib/balrog/view_helpers.rb