Class: MerbAdmin::Application

Inherits:
Merb::Controller
  • Object
show all
Defined in:
app/controllers/application.rb

Direct Known Subclasses

Forms

Instance Method Summary collapse

Instance Method Details

#set_modelObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/application.rb', line 7

def set_model
  @model_name = params[:model_name].to_s.camel_case.singularize
  begin
    @model = eval(@model_name)
  rescue StandardError
    raise NotFound
  end
  @properties = @model.properties.to_a
end