Module: RubyMVC

Defined in:
lib/ruby_mvc/module.rb,
lib/ruby_mvc/ar_support.rb,
lib/ruby_mvc/views/view.rb,
lib/ruby_mvc/application.rb,
lib/ruby_mvc/toolkit/app.rb,
lib/ruby_mvc/models/model.rb,
lib/ruby_mvc/toolkit/frame.rb,
lib/ruby_mvc/toolkit/dialog.rb,
lib/ruby_mvc/toolkit/widget.rb,
lib/ruby_mvc/views/form_view.rb,
lib/ruby_mvc/toolkit/web_view.rb,
lib/ruby_mvc/views/table_view.rb,
lib/ruby_mvc/toolkit/grid_view.rb,
lib/ruby_mvc/controllers/action.rb,
lib/ruby_mvc/models/table_model.rb,
lib/ruby_mvc/toolkit/messagebox.rb,
lib/ruby_mvc/views/ar_form_view.rb,
lib/ruby_mvc/views/browser_view.rb,
lib/ruby_mvc/models/ar_row_model.rb,
lib/ruby_mvc/views/ar_type_editor.rb,
lib/ruby_mvc/views/web_model_view.rb,
lib/ruby_mvc/models/ar_table_model.rb,
lib/ruby_mvc/views/grid_table_view.rb,
lib/ruby_mvc/toolkit/signal_handler.rb,
lib/ruby_mvc/views/ar_web_type_list.rb,
lib/ruby_mvc/views/web_content_view.rb,
lib/ruby_mvc/toolkit/browser_history.rb,
lib/ruby_mvc/views/ar_web_model_view.rb,
lib/ruby_mvc/controllers/action_group.rb,
lib/ruby_mvc/models/array_table_model.rb,
lib/ruby_mvc/toolkit/peers/wxruby/app.rb,
lib/ruby_mvc/controllers/app_controller.rb,
lib/ruby_mvc/models/view_model_template.rb,
lib/ruby_mvc/toolkit/peers/wxruby/frame.rb,
lib/ruby_mvc/controllers/action_provider.rb,
lib/ruby_mvc/toolkit/peers/wxruby/common.rb,
lib/ruby_mvc/toolkit/peers/wxruby/dialog.rb,
lib/ruby_mvc/controllers/rails_controller.rb,
lib/ruby_mvc/views/web_content_table_view.rb,
lib/ruby_mvc/toolkit/peers/wxruby/web_view.rb,
lib/ruby_mvc/models/keyed_array_table_model.rb,
lib/ruby_mvc/toolkit/peers/wxruby/grid_view.rb,
lib/ruby_mvc/toolkit/peers/wxruby/box_layout.rb,
lib/ruby_mvc/toolkit/peers/wxruby/grid_model.rb,
lib/ruby_mvc/toolkit/peers/wxruby/messagebox.rb,
lib/ruby_mvc/toolkit/property_change_notifier.rb,
lib/ruby_mvc/renderers/hyperlink_cell_renderer.rb,
lib/ruby_mvc/toolkit/peers/wxruby/form_builder.rb,
lib/ruby_mvc/renderers/html4_table_model_renderer.rb

Overview

Copyright 2011 Andrew S. Townley

Permission to use, copy, modify, and disribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notices and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

File: form_builder.rb Created: Fri 30 Dec 2011 17:20:42 CET

++

Defined Under Namespace

Modules: ActionProvider, LinkDispatcher, Models, Renderers, Toolkit, Views Classes: Action, ActionGroup, ActiveRecordModelRegistry, ActiveRecordTemplateRegistry, AppController, Application, RailsController

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.app(*args, &block) ⇒ Object

This method creates a default application and runs it using the active toolkit.



98
99
100
101
102
# File 'lib/ruby_mvc/application.rb', line 98

def self.app(*args, &block)
  Toolkit::App.new(*args) do
    Application.new(*args, &block)
  end
end

.method_name(str) ⇒ Object

This method is used to convert a name to a method name. It is borrowed and adapted from shoes.rb:538-540.



30
31
32
33
34
# File 'lib/ruby_mvc/module.rb', line 30

def self.method_name(str)
  str.to_s.gsub("/", "").gsub("::", "_").
          gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
          gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
end

.model(*args, &block) ⇒ Object



49
50
51
52
# File 'lib/ruby_mvc/ar_support.rb', line 49

def self.model(*args, &block)
  @ar_models ||= ActiveRecordModelRegistry.new
  @ar_models.model(etk, options)
end

.template(*args, &block) ⇒ Object



72
73
74
75
# File 'lib/ruby_mvc/ar_support.rb', line 72

def self.template(*args, &block)
  @ar_templates ||= ActiveRecordTemplateRegistry.new
  @ar_templates.template(*args, &block)
end

Instance Method Details

#model(*args, &block) ⇒ Object



81
82
83
# File 'lib/ruby_mvc/ar_support.rb', line 81

def model(*args, &block)
  RubyMVC.model(*args, &block)
end

#template(*args, &block) ⇒ Object



77
78
79
# File 'lib/ruby_mvc/ar_support.rb', line 77

def template(*args, &block)
  RubyMVC.template(*args, &block)
end