Module: Controller::AutosubmitConcern

Extended by:
ActiveSupport::Concern
Defined in:
app/concerns/controller/autosubmit_concern.rb

Overview

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