Module: Marley::Plugins::Section::ClassMethods
- Defined in:
- lib/marley/joints/section.rb
Instance Method Summary collapse
Instance Method Details
#authorize_rest_get(meth) ⇒ Object
19 20 21 |
# File 'lib/marley/joints/section.rb', line 19 def (meth) super || (meth.to_s=='section' && (respond_to?(:current_user) ? ! current_user.new? : true) ) end |
#section ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/marley/joints/section.rb', line 5 def section ReggaeSection.new({ :name => send_or_default(:section_name, resource_name.underscore), :title => send_or_default(:section_title, resource_name.humanize), :navigation => send_or_nil(:section_nav), :description => send_or_nil(:section_desc)}, send_or_nil(:section_content)) end |
#section_link ⇒ Object
13 14 15 |
# File 'lib/marley/joints/section.rb', line 13 def section_link reggae_link('section').update(:title => resource_name.humanize.pluralize) end |
#section_nav ⇒ Object
16 17 18 |
# File 'lib/marley/joints/section.rb', line 16 def section_nav send_or_default(:model_actions,{})[:get].map{|a| reggae_link(a)}.compact end |