Sha256: fd7d0c1d633b11f1b151584780ae9228e8c0031249de7b6ba9fe60f7eb13ed68
Contents?: true
Size: 814 Bytes
Versions: 22
Compression:
Stored size: 814 Bytes
Contents
module Alchemy module Admin module FormHelper # Use this form helper to render any form in Alchemy admin interface. # # This is simply a wrapper for `simple_form_for` # # == Defaults # # * It uses Alchemy::Forms::Builder as builder # * It makes a remote request, if the request was XHR request. # * It adds the alchemy class to form # def alchemy_form_for(object, *args, &block) options = args.extract_options! options[:builder] = Alchemy::Forms::Builder options[:remote] = request.xhr? options[:html] = { id: options.delete(:id), class: ["alchemy", options.delete(:class)].compact.join(' ') } simple_form_for(object, *(args << options), &block) end end end end
Version data entries
22 entries across 22 versions & 1 rubygems