Sha256: 7b689c46d26fbc431328932079fabf10dbf3fd096bf0c2dddb1c5e1e3c4d9db7
Contents?: true
Size: 1006 Bytes
Versions: 22
Compression:
Stored size: 1006 Bytes
Contents
module Raos module Controller # Handles automatic form submits. # # Prerequisites: # # Include the javascript: # # # app/assets/javascripts/application.js # //= require rails/add_ons/application/autosubmit # # Example: # # # app/controllers/posts_controller.rb # class PostsController < ApplicationController # include AutosubmitConcern # # # ... # # private # # def autosubmit? # true # end # end # # # app/views/posts/new.html.haml # = form_for(...) do |f| # = autosubmit # module AutosubmitConcern extend ActiveSupport::Concern included do helper Rao::AutosubmitHelper helper_method :autosubmit?, :autosubmit_now? end private def autosubmit? false end def autosubmit_now? autosubmit? && action_name == 'new' end end end end
Version data entries
22 entries across 22 versions & 1 rubygems