Class: MegaBar::LayoutSection
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- MegaBar::LayoutSection
- Defined in:
- app/models/mega_bar/layout_section.rb
Instance Attribute Summary collapse
-
#base_name ⇒ Object
Returns the value of attribute base_name.
-
#block_text ⇒ Object
Returns the value of attribute block_text.
-
#edit_model_display ⇒ Object
Returns the value of attribute edit_model_display.
-
#index_model_display ⇒ Object
Returns the value of attribute index_model_display.
-
#model_id ⇒ Object
Returns the value of attribute model_id.
-
#new_model_display ⇒ Object
Returns the value of attribute new_model_display.
-
#show_model_display ⇒ Object
Returns the value of attribute show_model_display.
-
#template_section_id ⇒ Object
Returns the value of attribute template_section_id.
Instance Method Summary collapse
Instance Attribute Details
#base_name ⇒ Object
Returns the value of attribute base_name.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def base_name @base_name end |
#block_text ⇒ Object
Returns the value of attribute block_text.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def block_text @block_text end |
#edit_model_display ⇒ Object
Returns the value of attribute edit_model_display.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def edit_model_display @edit_model_display end |
#index_model_display ⇒ Object
Returns the value of attribute index_model_display.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def index_model_display @index_model_display end |
#model_id ⇒ Object
Returns the value of attribute model_id.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def model_id @model_id end |
#new_model_display ⇒ Object
Returns the value of attribute new_model_display.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def new_model_display @new_model_display end |
#show_model_display ⇒ Object
Returns the value of attribute show_model_display.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def show_model_display @show_model_display end |
#template_section_id ⇒ Object
Returns the value of attribute template_section_id.
3 4 5 |
# File 'app/models/mega_bar/layout_section.rb', line 3 def template_section_id @template_section_id end |
Instance Method Details
#create_block_for_section ⇒ Object
13 14 15 16 17 18 |
# File 'app/models/mega_bar/layout_section.rb', line 13 def create_block_for_section # path_base: MegaBar::Page.find(self.page_id).path, # could be added in below. but doesnt look necessary. block_hash = {layout_section_id: self.id, name: self.code_name.humanize + ' Block', actions: 'current', model_id: self.model_id, new_model_display: 'y', edit_model_display: 'y', index_model_display: 'y', show_model_display: 'y'} block_hash = block_hash.merge(html: self.block_text) if self.block_text Block.create(block_hash) end |