Sha256: 6f144d33fa40ddb8e4149e9d2332210872c1950d82dbbda7213a86ca287bf7b9
Contents?: true
Size: 914 Bytes
Versions: 13
Compression:
Stored size: 914 Bytes
Contents
module CmsHelper def admin_tab(title, path) content_tag :li, link_to(title, path), class: (:current if request.path.include?(path)) end def available_parent_pages pages = [] pages << { title: t('qbrick.cms.pages.new.pages'), link: qbrick.cms_pages_path(locale: :en) } if params[:parent_id].present? parent_page = Qbrick::Page.find(params[:parent_id]) pages += parent_page.parent_pages end pages << { title: t('qbrick.cms.pages.new.new_page'), link: '#' } end def cms_brick_item(brick_list, type) type_name = type.class_name.constantize.model_name.human link_to type_name, qbrick.new_cms_brick_path( brick: { type: type.class_name, brick_list_id: brick_list.id, brick_list_type: brick_list.brick_list_type }), remote: true rescue NameError I18n.t type.class_name.underscore, scope: [:activerecord, :models] end end
Version data entries
13 entries across 13 versions & 1 rubygems