Sha256: 6758f33d3bbe58d6c347e190c9bd375219fecb875b7cf3708c40756daea526f0
Contents?: true
Size: 1.54 KB
Versions: 2
Compression:
Stored size: 1.54 KB
Contents
Rails.application.routes.draw do scope module: 'cms' do get 'viewables/new' => 'viewables#create', format: false, as: :new_viewable post 'viewables/edit' => 'viewables#update', format: true, constraints: { format: :js }, as: :edit_viewable get 'attachments/*directory/:file' => 'attachments#show', format: true Viewable::Page.with_url.each do |page| get page.url => "pages#show", format: false, defaults: { id: page.id, cms_view_type: page.view_name, cms_body_class: page.view_name, locale: page.locale } end if ActiveRecord::Base.connection.table_exists? 'viewable_pages' Viewable::Form.with_url.each do |form| get form.url => "forms#new", format: false, defaults: { id: form.id, cms_view_type: form.form_name, cms_body_class: form.form_name, locale: form.locale } post form.url => 'forms#create', defaults: { id: form.id, cms_view_type: form.form_name, cms_body_class: form.form_name, locale: form.locale } end if ActiveRecord::Base.connection.table_exists? 'viewable_forms' localized do resources :files, format: false, only: [:show] Viewable::Page.names.each do |name| get name => 'pages#show', format: false, defaults: { cms_view_type: name, cms_body_class: name } end Viewable::Form.names.each do |name| get name => 'forms#new', format: false, defaults: { cms_view_type: name, cms_body_class: name } post name => 'forms#create', defaults: { cms_view_type: name, cms_body_class: name } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rails_admin_cms-0.0.2 | config/routes.rb |
rails_admin_cms-0.0.1 | config/routes.rb |