Sha256: e834dbe095a1aa66475a7b03e7738331f34f6f435f8aced229c27de99118d135
Contents?: true
Size: 913 Bytes
Versions: 1
Compression:
Stored size: 913 Bytes
Contents
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 Rails::AddOns::AutosubmitHelper helper_method :autosubmit?, :autosubmit_now? end private def autosubmit? false end def autosubmit_now? autosubmit? && action_name == 'new' end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails-add_ons-3.0.0.pre1 | app/concerns/controller/autosubmit_concern.rb |