Sha256: cc624d731e7d2e9c9cc964184ddd4417dbcb5219f46b801d02c5cefb92fdf0fa

Contents?: true

Size: 518 Bytes

Versions: 3

Compression:

Stored size: 518 Bytes

Contents

class NestedFieldsController < ActionController::Base
  def add_nested_fields
    @association = params[:association].to_sym
    @builder = params[:builder].constantize
    @index = "#{Time.now.to_i}#{Time.now.usec}"
    @nested_partial = params[:nested_partial]
    @parent_form = params[:parent_form]

    @object = params[:parent_class].constantize.reflect_on_association(@association).klass.new

    respond_to do |format|
      format.js { render :partial => 'nested_fields/add_nested_fields' }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nested_fields-0.2.2 app/controllers/nested_fields_controller.rb
nested_fields-0.2.1 app/controllers/nested_fields_controller.rb
nested_fields-0.2.0 app/controllers/nested_fields_controller.rb