Class: Admin::FieldsController

Inherits:
Noodall::Admin::BaseController
  • Object
show all
Includes:
SortableTable::App::Controllers::ApplicationController
Defined in:
app/controllers/noodall/admin/fields_controller.rb

Instance Method Summary collapse

Instance Method Details

#newObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/noodall/admin/fields_controller.rb', line 7

def new

  field = "Noodall::#{params[:type].classify}".constantize
  # check that field class exists
  if defined?(field)
    @field = field.new
    
    respond_to do |format|
      format.html { render :layout => false, :partial => "noodall/admin/fields/#{params[:type]}", :locals => {:field => @field, :index => params[:index].to_i}}
      format.xml  { render :xml => @forms }
    end
  end
end