Sha256: 2372d75d67f78fa5b2fc88856022310ae13b24caae718fdd4bb00cb65bf52957

Contents?: true

Size: 723 Bytes

Versions: 56

Compression:

Stored size: 723 Bytes

Contents

module Para
  class NestedFieldsGenerator < Para::Generators::NamedBase
    include Para::Admin::BaseHelper
    include Para::Generators::FieldHelpers

    source_root File.expand_path("../templates", __FILE__)

    class_option :container, type: :boolean, default: false, :aliases => "-c"

    def generate_fields
      template(
        "_nested_fields.html.haml",
        "app/views/admin/#{ plural_namespaced_path }/_fields.html.haml"
      )
    end

    def generate_fields_container
      template(
        "../../../../../app/views/para/inputs/nested_many/_container.html.haml",
        "app/views/admin/#{ plural_namespaced_path }/nested_many/_container.html.haml"
      ) if options[:container]
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
para-0.12.4 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.12.3 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.12.2 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.12.1 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.12.0 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.11.4 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.11.3 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.11.2 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.11.1 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.11.0 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.10.0 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.9.4 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.9.3.3 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.9.3.2 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.9.3.1 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.9.2 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.9.0 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.8.15 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.8.14 lib/generators/para/nested_fields/nested_fields_generator.rb
para-0.8.13 lib/generators/para/nested_fields/nested_fields_generator.rb