Sha256: 9c033891171248b662d533bf986ac38b9a913e70c28c9cb3e5a5baf1760984b0
Contents?: true
Size: 944 Bytes
Versions: 29
Compression:
Stored size: 944 Bytes
Contents
require 'rao/view_helper/base' module Rao module ServiceController # Example: # # # app/controllers/application_controller.rb # require 'rao/service_controller/auto_submit_view_helper' # # class ApplicationController < ActionController::Base # view_helper Rao::ServiceController::AutoSubmitViewHelper, as: :auto_submit_helper # end # class AutoSubmitViewHelper < Rao::ViewHelper::Base # Example: # # # app/views/posts/new.html.haml # = form_for(...) do |f| # = auto_submit_helper(self).form_field # def form_field if auto_submit_now? c.content_tag(:div, nil, data: { 'auto-submit': true } ).html_safe end end def auto_submit? c.controller.send(:auto_submit?) end def auto_submit_now? c.controller.send(:auto_submit_now?) end end end end
Version data entries
29 entries across 29 versions & 1 rubygems