Files

Padrino::Generators::Admin::Actions

Important tasks for setting up or configuring the admin application.

Public Instance Methods

adapter() click to toggle source
Alias for: orm
add_project_module(controller) click to toggle source

Add access_control permission in our app.rb

# File lib/padrino-admin/generators/actions.rb, line 43
def add_project_module(controller)
  permission = "    role.project_module :#{controller}, \"/#{controller}\"\n"
  inject_into_file destination_root("/admin/app.rb"),  permission, :after => "access_control.roles_for :admin do |role|\n"
end
ext() click to toggle source

Tell us which rendering engine you are using

# File lib/padrino-admin/generators/actions.rb, line 22
def ext
  fetch_component_choice(:admin_renderer).to_sym rescue :haml
end
orm() click to toggle source

Tell us which orm we are using

# File lib/padrino-admin/generators/actions.rb, line 14
def orm
  fetch_component_choice(:orm).to_sym rescue :activerecord
end
Also aliased as: adapter
remove_project_module(controller) click to toggle source

Remove from access_control permissions

# File lib/padrino-admin/generators/actions.rb, line 51
def remove_project_module(controller)
  path = destination_root("/admin/app.rb")
  say_status :replace, "admin/app.rb", :red
  content = File.binread(path)
  content.gsub!(/^\s+role\.project_module :#{controller}, "\/#{controller}"\n/, '')
  File.open(path, 'wb') { |f| f.write content }
end
supported_ext() click to toggle source

Tell us for now wich rendering engine we support

# File lib/padrino-admin/generators/actions.rb, line 36
def supported_ext
  [:haml, :erb, :slim]
end
supported_orm() click to toggle source

Tell us for now wich orm we support

# File lib/padrino-admin/generators/actions.rb, line 29
def supported_orm
  [:datamapper, :activerecord, :mongomapper, :mongoid, :couchrest, :sequel]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.