Sha256: fee1dd3f902610ad4b770cd67fe818d10def69a0c23c9fcb1663c521ec81221b

Contents?: true

Size: 519 Bytes

Versions: 14

Compression:

Stored size: 519 Bytes

Contents

module Sunrise
  module StructureHelper
    def manage_structure_path(record, options = {})
      return "#" if record.nil?
      options = {:parent_id => record.id, :parent_type => 'Structure'}.merge(options)
      
      case record.structure_type.kind
      when :page then edit_path(:model_name => "pages", :id => record.id)
      when :posts then index_path(options.merge({:model_name => record.structure_type.kind}))
      else edit_path(:model_name => "structures", :id => record.id)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sunrise-cms-0.5.0 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.5.0.rc5 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.5.0.rc4 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.5.0.rc3 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.5.0.rc2 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.5.0.rc1 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.4.2 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.4.1 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.4.0 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.3.3 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.3.2 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.3.1 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.3.0 app/helpers/sunrise/structure_helper.rb
sunrise-cms-0.3.0.rc2 app/helpers/sunrise/structure_helper.rb