sisyphus-rails/lib/sisyphus-rails.rb

32 lines
726 B
Ruby
Raw Normal View History

2012-10-01 12:29:36 +00:00
require "sisyphus-rails/version"
require "sisyphus-rails/engine"
require "sisyphus-rails/form_helper"
require "sisyphus-rails/form_tag_helper"
2012-10-01 12:29:36 +00:00
module Sisyphus
mattr_accessor :process
2012-10-03 05:40:31 +00:00
mattr_accessor :app_root
mattr_accessor :config
2012-11-07 23:46:54 +00:00
mattr_accessor :form_builder
2012-10-03 05:40:31 +00:00
def self.setup
yield self
end
2012-11-07 23:46:54 +00:00
class FormBuilder
def initialize(template)
@template = template
end
def status
@template.content_tag(:div, message.html_safe, :class => 'sisyphus_status', :style => 'display: none')
end
def message
@template.t('sisyphus.autosaved_content') << @template.content_tag(:button, @template.t('sisyphus.revert'))
end
end
Sisyphus.form_builder = Sisyphus::FormBuilder
end