Class: QUI::Toolbar::Base
- Inherits:
-
Object
- Object
- QUI::Toolbar::Base
- Includes:
- ActionView::Helpers::AssetTagHelper, ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
- Defined in:
- lib/qui-toolbar-base.rb
Instance Method Summary collapse
- #create ⇒ Object
- #custom(options = {}) ⇒ Object
- #delete ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
-
#initialize(binding) ⇒ Base
constructor
A new instance of Base.
- #separator ⇒ Object
Constructor Details
#initialize(binding) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'lib/qui-toolbar-base.rb', line 8 def initialize(binding) @binding = binding @controller = eval("controller", @binding) end |
Instance Method Details
#create ⇒ Object
13 14 15 |
# File 'lib/qui-toolbar-base.rb', line 13 def create ({ :controller =>controller_name, :action => "new" }, :action => :create) end |
#custom(options = {}) ⇒ Object
29 30 31 |
# File 'lib/qui-toolbar-base.rb', line 29 def custom( = {}) [:content] end |
#delete ⇒ Object
21 22 23 |
# File 'lib/qui-toolbar-base.rb', line 21 def delete ({ :controller => controller_name, :action => "destroy" }, { :link_options => { :confirm => true, :method => :delete }, :action => :delete }) end |
#edit ⇒ Object
17 18 19 |
# File 'lib/qui-toolbar-base.rb', line 17 def edit ({ :controller => controller_name, :action => "edit" }, :action => :edit) end |
#index ⇒ Object
25 26 27 |
# File 'lib/qui-toolbar-base.rb', line 25 def index ({ :controller => controller_name, :action => "index" }, { :action => :index }) end |
#separator ⇒ Object
33 34 35 |
# File 'lib/qui-toolbar-base.rb', line 33 def separator content_tag(:div, "", :class => "separator") end |