verypossible / atomic_assets

5 stars 1 forks source link

asset generator has atomic_cms specific code in it #9

Open bbrock25 opened 9 years ago

bbrock25 commented 9 years ago

We should migrate most of the methods out of the templates/component.rb file and push that logic over to the CMS specific generators.

  def edit
    rtn = cms_fields(field_types)
    rtn << h.component(<%= ":#{@component.key}" %>, field_previews).render
    rtn.html_safe
  end

  protected

  def field_previews
    {
      header: "{{preview.header}}",
      content: markdown_preview('preview.content')
    }
  end

  def field_types
    {
      header: { field_type: "text" },
      content: { field_type: "markdown" }
    }
  end

and from the component if add_option(options[:header]) is an active controller hack that is included in the AtomicCms readme, not even the project.

Lets clean it up!

squaresurf commented 9 years ago

Sorry, but this makes no sense.

We should most all of the methods out of the asset.rb file

bbrock25 commented 9 years ago

@squaresurf yeah, premature submit, updated the description above.

squaresurf commented 9 years ago

Sorry, but this still makes no sense:

We should most all of the methods out of the