Sha256: af026d73aa97415f1d5fc38c79a2fa35c4676acd5e0864a07a141111c5a0c147

Contents?: true

Size: 884 Bytes

Versions: 17

Compression:

Stored size: 884 Bytes

Contents

if defined?(ActionController) and defined?(ActionController::Base)

  class ActionController::Base

    helper_method :activate_whowish_word_edit_mode
    attr_accessor :whowish_word_edit_mode
    
    def activate_whowish_word_edit_mode
      @whowish_word_edit_mode = true
    end

    def word_for(namespace, id, *variables)
      
      if @whowish_word_edit_mode == true
        return WhowishWord.word_for_in_edit_mode(namespace, id, *variables)
      else
        return WhowishWord.word_for(namespace, id, *variables)
      end
      
    end
    
    def word_for_attr(namespace, id, *variables)
      
      if @whowish_word_edit_mode == true
        return WhowishWord.word_for_attr_in_edit_mode(namespace, id, *variables)
      else
        return WhowishWord.word_for_attr(namespace, id, *variables)
      end
      
    end

  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
whowish_word-0.2.7 lib/whowish_word/action_controller/base.rb
whowish_word-0.2.6 lib/whowish_word/action_controller/base.rb
whowish_word-0.2.5 lib/whowish_word/action_controller/base.rb
whowish_word-0.2.3 lib/whowish_word/action_controller/base.rb
whowish_word-0.2.2 lib/whowish_word/action_controller/base.rb
whowish_word-0.2.1 lib/whowish_word/action_controller/base.rb
whowish_word-0.2.0 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.9 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.8 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.7 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.6 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.5 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.4 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.3 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.2 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.1 lib/whowish_word/action_controller/base.rb
whowish_word-0.1.0 lib/whowish_word/action_controller/base.rb