Class: ErpApp::Widgets::Base
- Inherits:
-
ActionController::Metal
- Object
- ActionController::Metal
- ErpApp::Widgets::Base
- Includes:
- AbstractController, ActionController::DataStreaming, ActionController::RequestForgeryProtection, ActionController::Streaming, Callbacks, Helpers, Layouts, Logger, Rendering, Translation
- Defined in:
- lib/erp_app/widgets/base.rb
Constant Summary collapse
- IGNORED_PARAMS =
%w{action controller uuid widget_name widget_action dynamic_form_id dynamic_form_model_id model_name use_dynamic_form authenticity_token is_html_form commit utf8}
Instance Attribute Summary collapse
-
#div_id ⇒ Object
Returns the value of attribute div_id.
-
#html ⇒ Object
Returns the value of attribute html.
-
#name ⇒ Object
Returns the value of attribute name.
-
#proxy_controller ⇒ Object
Returns the value of attribute proxy_controller.
-
#state_name ⇒ Object
readonly
Returns the value of attribute state_name.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
-
#view ⇒ Object
Returns the value of attribute view.
-
#widget_params ⇒ Object
Returns the value of attribute widget_params.
Class Method Summary collapse
Instance Method Summary collapse
-
#_prefixes ⇒ Object
override default behavior of nesting views by controller namespace.…
-
#initialize(proxy_controller = nil, name = nil, view = nil, uuid = nil, widget_params = nil) ⇒ Base
constructor
A new instance of Base.
- #render(*args) ⇒ Object
- #widget_result_id ⇒ Object
Constructor Details
#initialize(proxy_controller = nil, name = nil, view = nil, uuid = nil, widget_params = nil) ⇒ Base
Returns a new instance of Base.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/erp_app/widgets/base.rb', line 33 def initialize(proxy_controller=nil, name=nil, view=nil, uuid=nil, =nil) ErpApp::Widgets::Base.view_resolver_cache = [] if ErpApp::Widgets::Base.view_resolver_cache.nil? self.name = name self.proxy_controller = proxy_controller self.view = view self.uuid = uuid self. = add_view_paths merge_params end |
Instance Attribute Details
#div_id ⇒ Object
Returns the value of attribute div_id.
30 31 32 |
# File 'lib/erp_app/widgets/base.rb', line 30 def div_id @div_id end |
#html ⇒ Object
Returns the value of attribute html.
30 31 32 |
# File 'lib/erp_app/widgets/base.rb', line 30 def html @html end |
#name ⇒ Object
Returns the value of attribute name.
30 31 32 |
# File 'lib/erp_app/widgets/base.rb', line 30 def name @name end |
#proxy_controller ⇒ Object
Returns the value of attribute proxy_controller.
30 31 32 |
# File 'lib/erp_app/widgets/base.rb', line 30 def proxy_controller @proxy_controller end |
#state_name ⇒ Object (readonly)
Returns the value of attribute state_name.
29 30 31 |
# File 'lib/erp_app/widgets/base.rb', line 29 def state_name @state_name end |
#uuid ⇒ Object
Returns the value of attribute uuid.
30 31 32 |
# File 'lib/erp_app/widgets/base.rb', line 30 def uuid @uuid end |
#view ⇒ Object
Returns the value of attribute view.
30 31 32 |
# File 'lib/erp_app/widgets/base.rb', line 30 def view @view end |
#widget_params ⇒ Object
Returns the value of attribute widget_params.
30 31 32 |
# File 'lib/erp_app/widgets/base.rb', line 30 def @widget_params end |
Class Method Details
.installed_widgets ⇒ Object
157 158 159 |
# File 'lib/erp_app/widgets/base.rb', line 157 def self. end |
.render_template(view, locals = {}) ⇒ Object
146 147 148 149 150 151 |
# File 'lib/erp_app/widgets/base.rb', line 146 def render_template(view, locals={}) = Rails.application.config.erp_app..find{|item| item[:name] == self.} paths = [:view_paths] ActionView::Base.new(paths).render(:template => view, :locals => locals) end |
.widget_name ⇒ Object
153 154 155 |
# File 'lib/erp_app/widgets/base.rb', line 153 def File.basename(File.dirname(__FILE__)) end |
Instance Method Details
#_prefixes ⇒ Object
override default behavior of nesting views by controller namespace.… The prefixes used in render “foo” shortcuts.
47 48 49 |
# File 'lib/erp_app/widgets/base.rb', line 47 def _prefixes @_prefixes ||= [] end |
#render(*args) ⇒ Object
55 56 57 |
# File 'lib/erp_app/widgets/base.rb', line 55 def render(*args) render_view_for(self.action_name, *args) end |
#widget_result_id ⇒ Object
51 52 53 |
# File 'lib/erp_app/widgets/base.rb', line 51 def "#{self.uuid}_result" end |