class Scrivito::Generators::WidgetGenerator

Public Instance Methods

class_name() click to toggle source
Calls superclass method
# File lib/generators/scrivito/widget/widget_generator.rb, line 23
def class_name
  super.ends_with?('Widget') ? super : "#{super}Widget"
end
create_model() click to toggle source
# File lib/generators/scrivito/widget/widget_generator.rb, line 9
def create_model
  template 'model.erb', "app/models/#{file_name}.rb"
end
create_views() click to toggle source
# File lib/generators/scrivito/widget/widget_generator.rb, line 13
def create_views
  template 'show.html.erb', "app/views/#{file_name}/show.html.erb"
  template 'details.html.erb', "app/views/#{file_name}/details.html.erb"
  template 'thumbnail.html.erb', "app/views/#{file_name}/thumbnail.html.erb"
end
file_name() click to toggle source
Calls superclass method
# File lib/generators/scrivito/widget/widget_generator.rb, line 19
def file_name
  super.ends_with?('_widget') ? super : "#{super}_widget"
end