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 authorize_rest_get(meth)
  super || (meth.to_s=='section' && (respond_to?(:current_user) ? ! current_user.new? : true) )
end

#sectionObject



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


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_navObject



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