class Object

Public Class Methods

display_icon() click to toggle source
# File lib/generators/forest/block/templates/model.rb, line 20
def self.display_icon
  'glyphicon glyphicon-play'
end
display_name() click to toggle source
# File lib/generators/forest/block/templates/model.rb, line 11
def self.display_name
  '<%= class_name.titleize %>'
end

Public Instance Methods

edit() click to toggle source
# File lib/generators/forest/scaffold/templates/admin_controller.rb, line 18
def edit
  authorize @<%= singular_name %>
end

def create
  @<%= singular_name %> = <%= name %>.new(<%= singular_name %>_params)
  authorize @<%= singular_name %>

  if @<%= singular_name %>.save
    redirect_to edit_admin_<%= singular_name %>_path(@<%= singular_name %>), notice: '<%= name %> was successfully created.'
  else
    render :new
  end
show() click to toggle source
# File lib/generators/forest/scaffold/templates/admin_controller.rb, line 9
def show
  authorize @<%= singular_name %>
end

def new
  @<%= singular_name %> = <%= name %>.new
  authorize @<%= singular_name %>
end